fork download
  1. #include<iostream>
  2. using namespace std;
  3. int x;
  4. int main()
  5. {
  6. int x=1;
  7. int t;
  8. cin>>t;
  9. while(t--)
  10. {
  11. int flag=0;
  12. int n,m;
  13. cin>>n;
  14. cin>>m;
  15. //int a[m];
  16. int a[1000];
  17. for(int i=0;i<m;i++)
  18. {
  19. cin>>a[m];
  20. }
  21. //cout<<"A";
  22. int temp;
  23. for(int i=0;i<m;i++)
  24. {
  25. for(int j=i+1;j<m;j++)
  26. {
  27. if(a[i]+a[j]==n)
  28. {
  29. cout<<"Case #"<<x++<<": ";
  30. cout<<i<<" "<<j;
  31. flag=1;
  32. break;
  33. }
  34. }
  35. if(flag==1)break;
  36. }
  37. }
  38. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
100
3
5 75 25
200
7
150 24 79 50 88 345 3
8
8
2 1 9 4 4 56 90 3
compilation info
prog.cs(2,0): error CS1024: Wrong preprocessor directive
prog.cs(2,6): error CS1041: Identifier expected, `namespace' is a keyword
prog.cs(2,19): error CS1001: Unexpected symbol `;', expecting identifier
prog.cs(6,4): error CS1041: Identifier expected, `int' is a keyword
prog.cs(11,8): error CS1041: Identifier expected, `int' is a keyword
prog.cs(19,12): error CS1001: Unexpected symbol `cin', expecting identifier
prog.cs(25,12): error CS1041: Identifier expected, `for' is a keyword
prog.cs(27,16): error CS1041: Identifier expected, `if' is a keyword
prog.cs(29,20): error CS1001: Unexpected symbol `cout', expecting identifier
prog.cs(38,1): error CS8025: Parsing error
Compilation failed: 10 error(s), 0 warnings
stdout
Standard output is empty