[ create a new paste ] login | about

Link: http://codepad.org/5qJaWoGM    [ raw code | fork ]

C, pasted on Mar 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == '+') {
      printf("add\n");
    } else if (c == '-') {
      printf("sub\n");
    } else if (c == '*') {
      printf("mul\n");
    } else if (c == '/') {
      printf("div\n");
    }
  }
  return 0;
}
/* end */


Output:
No errors or program output.


Create a new paste based on this one


Comments: