2 solutions
-
2
#include<bits/stdc++.h> using namespace std; bool check(int x) { if(x<2) return false; for(int i=2;i<=x/i;i++) { if(x%i==0) return false; } return true; } int main() { for(int i=2;i<=100;i++) { for(int j=i+1;j<=100;j++) { int t=i+j; if(t%2!=0) continue; t=t/2; if(check(i)&&check(j)&&check(t)) { cout<<i<<" "<<t<<" "<<j<<endl; } } } return 0; }
-
0
3 5 7 3 7 11 3 11 19 3 13 23 3 17 31 3 23 43 3 31 59 3 37 71 3 41 79 3 43 83 5 11 17 5 17 29 5 23 41 5 29 53 5 47 89 7 13 19 7 19 31 7 37 67 7 43 79 11 17 23 11 29 47 11 41 71 11 47 83 13 37 61 13 43 73 17 23 29 17 29 41 17 53 89 19 31 43 19 43 67 23 41 59 23 47 71 23 53 83 29 41 53 29 59 89 31 37 43 37 67 97 41 47 53 43 61 79 47 53 59 47 59 71 53 71 89 59 71 83 61 67 73 61 79 97 67 73 79
直接cout
- 1
Information
- ID
- 111
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 1
- Tags
- (None)
- # Submissions
- 37
- Accepted
- 17
- Uploaded By