#include<iostream> #include<cstring> #include<string> #include<algorithm> #include<vector> using namespace std; int main() { int n; while (cin >> n && n != 0) { int temp = 0; for (int i = 1; i <= n; i++) { temp = (temp + 3) % i; } cout << temp+1 << endl; } return 0; /* Main.cc: In function 'int main()': Main.cc:20:10: error: expected '}' at end of input return 0; ^ Main.cc:9:1: note: to match this '{' { ^ */ |
Double click to view unformatted code.