fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. unsigned int address;
  5. int size;
  6. char operation;
  7. char comma;
  8. printf("START \n");
  9. while(fscanf(stdin, " %c %x%c%d", &operation, &address, &comma, &size) > 0){
  10. printf("O: %c", operation);
  11. printf("\n");
  12. printf("A: %x", address);
  13. printf("\n");
  14. printf("C: %c", comma);
  15. printf("\n");
  16. printf("S: %d", size);
  17. printf("\n");
  18. }
  19. printf("END \n");
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2296KB
stdin
 L 10,4 
 S 18,4
 L 20,4
 S 28,4
 S 50,4
stdout
START 
O: L
A: 10
C: ,
S: 4
O: S
A: 18
C: ,
S: 4
O: L
A: 20
C: ,
S: 4
O: S
A: 28
C: ,
S: 4
O: S
A: 50
C: ,
S: 4
END