-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path45.c
More file actions
30 lines (26 loc) · 636 Bytes
/
Copy path45.c
File metadata and controls
30 lines (26 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#define limit (80000)
int main(){
int T[limit];
int P[limit];
int H[limit];
for(int i=1;i<limit;i++){
T[i]=i*(i+1)/2;
P[i]=i*(3*i-1)/2;
H[i]=i*(2*i-1);
}
for(int t=285;t<limit;t++){
for(int p=165;p<t;p++){
for(int h=143;h<p;h++){
if(T[t]==P[p]){
if(P[p]==H[h]){
printf("T[%d] = %d",t,T[t]);
}
}
else{
break;
}
}
}
}
}