fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a,b,c,d;
  6. scanf("%d%d",&a,&b);
  7. c=a/b;
  8. d=a%b;
  9. if(b==0){
  10. printf("終了");
  11. }
  12. else{
  13. switch(d){
  14. case 0:
  15. printf("%d÷%d=%d",a,b,c);
  16. break;
  17. default:
  18. printf("%d÷%d=%d余り%d",a,b,c,d);
  19. break;
  20. }
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5320KB
stdin
8
0
stdout
終了