Compile Error
foo.cc: In function 'int main()': foo.cc:12:30: error: 'n' was not declared in this scope 12 | while (t-- && cin >> n) | ^
Code
#include <iostream>
#include <string>
using namespace std;
string ans[] = { "RGB","GRB","GBR","BGR","BRG","RBG" };
int main()
{
int t, k;
cin >> t;
while (t-- && cin >> n)
{
cout << ans[n % 7] << "\n";
}
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1010 Red Green Blue
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2023-12-10 18:24:51
- Judged At
- 2023-12-14 04:38:59
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes