fork download
  1. #include "stdio.h"
  2.  
  3. int main()
  4. {
  5. int i = 0, j = 0;
  6. char data[256] = "1@2@3@4@5";
  7. char question[256][256];
  8. for (i = 0; i < 256; ++i) {
  9. question[i][0] = '\0';
  10. }
  11.  
  12. i=-1;
  13. int lastj=0;
  14. while (1) {
  15. ++i;
  16. for (j ; data[j] != '@' && data[j] != '\0' ; j++) {
  17. question[i][j-lastj] = data[j];
  18. }
  19. question[i][j-lastj] = '\0';
  20. if (data[j] == '\0') {
  21. break;
  22. }
  23. j++;
  24. lastj=j;
  25. }
  26.  
  27. for (i=0; i<256; ++i) {
  28. printf ("%s\n", question[i]);
  29. }
  30. }
Runtime error #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
1
2
3
4
5