1 solutions

  • 0
    @ 2022-2-4 17:25:38

    #include<bits/stdc++.h> using namespace std; int main() { int x, y; while (cin >> x >> y) { if (x == 0 && y == 0) break; else { int flag = 0; for (int i = x; i <= y; i++) { int f = i * i + i + 41; for (int i = 2; i < f; i++) { if (f % i == 0) { flag++; cout << "Sorry" << endl; break; }

    			}
    	  }
    		if (!flag)cout << "OK" << endl;
    	}
    }
    return 0;
    

    }

    • 1

    Information

    ID
    329
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    6
    Tags
    # Submissions
    191
    Accepted
    61
    Uploaded By