fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define max3(a,b,c) max(max(a,b),c)
  4. #define min3(a,b,c) min(min(a,b),c)
  5. #define PI acos(-1.0)
  6. #define LL long long
  7. #define INF_MAX 2147483647
  8. #define INF_MIN -2147483647
  9. #define MX 1000005
  10. #define MOD 1000000007
  11. int main()
  12. {
  13. //freopen("a.in", "r", stdin);
  14. //freopen("a.out", "w", stdout);
  15. int n,t=1;
  16. char s[1001];
  17. while(cin>>n)
  18. {
  19. if(n==0) break;
  20. cout<<"Case "<<t++<<":"<<endl;
  21. cout<<"#include<string.h>"<<endl;
  22. cout<<"#include<stdio.h>"<<endl;
  23. cout<<"int main()"<<endl;
  24. cout<<"{"<<endl;
  25.  
  26. getchar();
  27. while(n--)
  28. {
  29. //getchar();
  30. gets(s);
  31. cout<<"printf(\"";
  32. for(int i=0;i<strlen(s);i++)
  33. {
  34. if(s[i]=='\"' || s[i]=='\\')
  35. cout<<"\\";
  36. cout<<s[i];
  37. }
  38.  
  39. cout<<"\\n\");"<<endl;
  40. }
  41. cout<<"printf(\"";
  42. cout<<"\\n\");"<<endl;
  43. cout<<"return 0;"<<endl;
  44. cout<<"}"<<endl;
  45. //}
  46. }
  47. }
  48.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
"I like to solve"
I do not like to code
1
yeah accepted
0
compilation info
prog.cpp: In function 'int main()':
prog.cpp:30:19: error: 'gets' was not declared in this scope
             gets(s);
                   ^
stdout
Standard output is empty