-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path44.c
More file actions
40 lines (30 loc) · 788 Bytes
/
Copy path44.c
File metadata and controls
40 lines (30 loc) · 788 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
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
// int check(int P[1000],int D[1000], int S[1000],int d){
// for(int p=1;p<1000;p++){
// if(D[d]!=P[p]){
// printf("D[%d] != P[%d]\n",d,p);
// break;
// }
// if(S[d]!=P[p]){
// printf("D[%d] != P[%d]\n",d,p);
// break;
// }
// else{
// printf("%d",P[p]);
// }
// }
// }
int main(){
int P[1000];
int S[1000];
int D[1000];
for(int i=1;i<1000;i++){
P[i]=i*(3*i-1)/2;
D[i]=3*i+1;
S[i]=3*i*i+2*i+1;
printf("%d %d %d %d\n",i,P[i],D[i],S[i]);
}
// for(int d=1;d=1000;d++){
// check(P,D,S,d);
// }
}