fork download
  1. #include <stdio.h>
  2.  
  3. int Answer;
  4. int a[3];
  5. void ten(int b){
  6. Answer=1;
  7. a[0]=b;
  8. }
  9. void hun(int b){
  10. int i,c;
  11. if(b%10==b/10){
  12. a[0]=b;
  13. Answer=1;
  14. }
  15. else{
  16. for(i=0;i<10;i++){
  17. b--;
  18. if(b%10==b/10){
  19. a[0]=b;
  20. c-=b;
  21. break;
  22. }
  23. }
  24. if(c<10){
  25. Answer=2;
  26. a[1]=c;
  27. }
  28. else{
  29. Answer=3;
  30. a[1]=9;
  31. a[2]=1;
  32. }
  33. }
  34. }
  35. }
  36. void thousand(int b){
  37.  
  38. }
  39. int main(void)
  40. {
  41. int T, test_case;
  42. int b;
  43. scanf("%d", &T);
  44. for(test_case = 0; test_case < T; test_case++)
  45. {
  46. scanf("%d",&b);
  47. if(b<10)
  48. ten;
  49. else if(b<100)
  50. hun;
  51. /* else if(b<1000){
  52. if(b/100==b%100){
  53. Answer=1;
  54. a[0]=b;
  55. }
  56. else{
  57. for(i=0;i<100;i++){
  58. b--;
  59. if(b/100==b%100){
  60. a[0]=b;
  61. c-=b;
  62. break;
  63. }
  64.  
  65. }
  66.  
  67.  
  68. }
  69. }*/
  70. printf("Case #%d\n", test_case+1);
  71. printf("%d ", Answer);
  72. if(Answer!=0){
  73. for(i=0;i<Answer;i++){
  74. printf("%d ",a[i]);
  75. }
  76. }
  77. printf("\n");
  78. }
  79.  
  80. return 0;
  81. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
99
compilation info
prog.c:35:1: error: expected identifier or ‘(’ before ‘}’ token
 }
 ^
prog.c: In function ‘main’:
prog.c:48:4: warning: statement with no effect [-Wunused-value]
    ten;
    ^~~
prog.c:50:4: warning: statement with no effect [-Wunused-value]
    hun;
    ^~~
prog.c:73:14: error: ‘i’ undeclared (first use in this function)
          for(i=0;i<Answer;i++){
              ^
prog.c:73:14: note: each undeclared identifier is reported only once for each function it appears in
stdout
Standard output is empty