We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89f09dc commit 400057eCopy full SHA for 400057e
755A - PolandBall and Hypothesis.cpp
@@ -0,0 +1,41 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+// Code Written By: Vikash Patel
5
6
+bool isPrime(int x)
7
+{
8
+ if (x<=1)
9
+ {
10
+ return false;
11
+ }
12
+ for(int i=2;i<x;i++)
13
14
+ if(x%i==0)
15
16
17
18
19
+ return true;
20
+}
21
22
+int main()
23
24
+ int n;
25
+ cin>>n;
26
+ int ans;
27
+ for(int m=1;m<=1000;m++)
28
29
+ if(!isPrime(n*m+1))
30
31
+ ans=m;
32
+ break;
33
34
35
+ cout<<ans<<endl;
36
37
38
39
40
41
0 commit comments