-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
段林林level 1前五题 #38
base: master
Are you sure you want to change the base?
段林林level 1前五题 #38
Changes from 17 commits
ec155e9
130c26b
885ac15
3429b58
9fc51c3
3ea8b68
ae342e5
6bfa2d9
34ae7f8
728f935
2257dfa
ad50f62
3ae0cbf
41faf95
7df5774
e37ae13
94d4445
6f46361
7b50f8d
f10cbf9
6c1c9dc
6d26b48
13f7e95
e560197
3c9fb1a
b531f3d
75f01da
107ba36
267e472
01a5abe
0d0aee9
8e06117
229fe72
2bed589
cea70ac
d75de3b
414f313
307b056
c502e87
eca01d6
fdd83bc
c8a276b
8c20667
c4677e7
7179341
534e375
631efe5
ff4166a
a32c373
c80d1f4
1ce7075
9fc4b00
c4a6edc
d68d043
557deae
e88e7a4
cf6c404
86b853d
bf9e115
e9a66f1
5a91a8e
0e41e22
d3f77e1
a2b7d67
1881faa
96ebb56
91ae8e8
799cbbf
9271a51
bbf76d4
630297b
b8f4fb6
e7d88a4
4dec92b
5e49136
4d602f1
35e9681
6f87f4d
dd9bda5
83b0b48
c7832dc
07e69bc
e4f3a5a
6b3289e
da1e4d1
3830cb8
5b2e82f
79d41e1
ce2ac19
1efe740
4539388
9be32d9
a0e66fe
40d4996
775789c
9ae4483
1e011aa
a95ede0
011a403
3c82f90
b6917ac
2d6bc70
41527d8
7711676
69aa8b9
e75cf1e
d6f434d
82ea306
92de10e
5efdb9b
7973993
7038d71
8f4d5de
0562bf0
539c278
9f9f491
a49f3fb
a2c5d8b
28351cc
aae1ce7
79d7f0b
c69491b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include<stdio.h> | ||
int main(void) | ||
{ | ||
int number[10]={0}; | ||
int i,j; | ||
|
||
for(i=1;i<=5;i++){ | ||
scanf("%d",&j); | ||
number[j]=1; | ||
} | ||
|
||
for(i=1;i<=9;i++){ | ||
if(number[i]==0){ | ||
printf("%d",i); | ||
} | ||
|
||
} | ||
return 0; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int i = 0; | ||
|
||
for(i = 0;i <1000;++i){ | ||
printf("Hello!\n"); | ||
} | ||
|
||
return 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 缩进对齐 |
||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int ou,i=0; | ||
|
||
for(ou = 2;i < 50;++i){ | ||
printf("%d\n",ou); | ||
ou += 2; | ||
} | ||
|
||
return 0; | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int n = 0; | ||
printf("Please input n:"); | ||
scanf("%d",&n); | ||
|
||
if (0==n%13) | ||
printf("%d ÊÇ13µÄ±¶Êý",n); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 缩进的规格要保持一致,这叫漂亮的代码风格 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 嗯嗯,谢谢老师,马上改 |
||
else | ||
printf("%d ²»ÊÇ13µÄ±¶Êý",n); | ||
|
||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int k,i=0; | ||
|
||
for(k =0 ;i <= 100;++i){ | ||
k = ++k; | ||
if(0 == k % 3 && 0 != k % 5){ | ||
printf("%d\n",k); | ||
} | ||
} | ||
|
||
return 0; | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int k,j=0,i=0; | ||
|
||
for(k =0 ;i < 100;++i){ | ||
k = ++k; | ||
if(0 == k % 7 ){ | ||
printf("%d\n",k); | ||
} | ||
} | ||
|
||
for( j = 0;j<10;++j){ | ||
printf("%d\n",k=j*10+7); | ||
} | ||
|
||
|
||
return 0; | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int i,j; | ||
|
||
for(i=1;i<=9;++i){ | ||
for(j=1;j<=i;++j) | ||
printf("%d*%d=%d\t",j,i,i*j); | ||
printf("\n"); | ||
} | ||
|
||
|
||
return 0; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <stdio.h> | ||
|
||
/* run this program using the console pauser or add your own getch, system("pause") or input loop */ | ||
|
||
int main(int argc, char *argv[]) { | ||
printf("hello world,I am Duan Linlin!"); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include<stdio.h> | ||
#define M 10000 | ||
int main(void) | ||
{ | ||
int i,j=0,n; | ||
int a[M],b[M]; | ||
|
||
printf("please input n:\n"); | ||
scanf("%d",&n); | ||
printf("please input %d numbers:\n",n); | ||
|
||
for(i=1;i<=n;++i){ | ||
scanf("%d",&a[i]); | ||
} | ||
|
||
for(i=n;i>=0;i--){ | ||
b[++j]=a[i]; | ||
} | ||
|
||
for(i=1;i<=n;++i){ | ||
printf("%d\t",b[i]); | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int year = 0; | ||
|
||
printf("Please input year:"); | ||
scanf("%d",&year); | ||
|
||
if ((0 != year % 100 && 0 == year % 4) || 0 == year % 400) | ||
|
||
printf("%d is leap year",year); | ||
else | ||
printf("%d 不是闰年",year); | ||
|
||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include<stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int m,n,l,s,i; | ||
printf("您想输入几个数字:"); | ||
scanf("%d",&n); | ||
printf("please input %d numbers:\n",n); | ||
|
||
for(i=0;i<n ;++i){ | ||
scanf("%d",&m); | ||
if(m>l){ | ||
s=m; | ||
l=s;} | ||
} | ||
|
||
printf("%d 是这些数字中最大的",s); | ||
|
||
|
||
return 0; | ||
|
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int n = 0; | ||
|
||
printf("Please input n:"); | ||
scanf("%d",&n); | ||
|
||
if (n>0) | ||
printf("%d is positive number\n",n); | ||
else if (n<0) | ||
printf("%d is negative number\n",n); | ||
else | ||
printf("%d is zero\n",n); | ||
|
||
if (0 == n % 2) | ||
printf("%d is a even\n",n); | ||
else | ||
printf("%d is a obb\n",n); | ||
|
||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int bai,shi,ge; | ||
int shui_xian_shu; | ||
|
||
printf("Please output all shui_xian_shus:\n"); | ||
for(bai=1;bai<10;++bai){ | ||
for(shi=0;shi<10;++shi){ | ||
for(ge=0;ge<10;++ge){ | ||
shuixianshu = bai*100 + shi*10 + ge; | ||
|
||
if (bai*bai*bai + shi*shi*shi + ge*ge*ge == shui_xian_shu) | ||
printf("%5d\n",shui_xian_shu); | ||
} | ||
} | ||
} | ||
|
||
printf("\n"); | ||
|
||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缩进一格太小