-
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
L0 有些重复 #44
base: master
Are you sure you want to change the base?
L0 有些重复 #44
Changes from 5 commits
1461d81
6e01ae9
70de778
5bb6bc3
ae78780
bf52a24
519c20b
6d854d5
4e60002
f430b3b
6fbf106
cc3cbb6
357654f
572c795
5eb085c
4ad7c70
43597b7
c3bad89
fcd606b
dd81311
8ce52ed
3851542
9b4a5b8
4848cc1
866acb7
4009b32
b96672c
cb0845c
416439b
5d8eee0
b787db5
3aacdd1
b828a32
4528cdd
01cb96f
e972cca
b47f338
b785668
dda98ab
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,18 @@ | ||
#include<stdio.h> | ||
void move(int n,int x,int y,int z) | ||
{ | ||
if(n==1) | ||
{ | ||
move(n-1,x,z,y); | ||
printf("%c->%c\n",x,z); | ||
move(n-1,y,x,z); | ||
} | ||
} | ||
void main() | ||
{ | ||
int h; | ||
printf("\ninputnumber:\n"); | ||
scanf("%d",&h); | ||
printf("the step to moving %2d diskes:\n",h); | ||
move(h,'a','b','c'); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include<stdio.h> | ||
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. 文件名不能用中文 |
||
main() | ||
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. main函数需要有返回类型 |
||
{ | ||
int i; | ||
for(i=1;i<=10000;i++) | ||
printf("hello "); | ||
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,7 @@ | ||
#include<stdio.h> | ||
main() | ||
{ | ||
int a; | ||
for(a=2;a<=100;a=a+2) | ||
printf("%d ",a); | ||
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,21 @@ | ||
#include <stdio.h> | ||
void main() | ||
{ | ||
int a,b,c; | ||
printf("������������"); | ||
scanf("%d %d %d",&a,&b,&c); | ||
if(a>b) | ||
{ | ||
if(a>c) | ||
printf("����Ϊ%d",a); | ||
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",c); | ||
} | ||
else | ||
{ | ||
if(b<c) | ||
printf("����Ϊ%d",c); | ||
else | ||
printf("����Ϊ%d",b); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include<stdio.h> | ||
main() | ||
{ | ||
int a; | ||
for(a=1;a<=100;a++) | ||
{ | ||
if(a%3==0&&a%5!=0) | ||
printf("%d\n",a); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include<stdio.h> | ||
main() | ||
{ | ||
int a[5]; | ||
printf("����5����"); | ||
int i,b; | ||
for(i=1;i<=5;i++) | ||
{ | ||
scanf("%d",&a[i]); | ||
} | ||
printf("û�г��ֵ���Ϊ"); | ||
for(b=0;b<=9;b++) | ||
if(b!=a[1]&&b!=a[2]&&b!=a[3]&&b!=a[4]&&b!=a[5]) | ||
printf("%d",a[i]); | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include<stdio.h> | ||
void main() | ||
{ | ||
int a,b,k; | ||
const n=5; | ||
int i[n]; | ||
printf("������5��0-9������\n"); | ||
for(a=1;a<=n;a++) | ||
{ | ||
printf("i[%d]=",a); | ||
scanf("%d",&i[a]); | ||
} | ||
for(a=1;a<n;a++) | ||
for(b=1;b<=n-a;b++) | ||
if(i[b]>i[b+1]) | ||
{ | ||
k=i[b]; | ||
i[b]=i[b+1]; | ||
i[b+1]=k; | ||
} | ||
for(a=1;a<=n;a++) | ||
printf("%d\n",i[a]); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
int a,b,c; | ||
printf(" *"); | ||
for(a=1;a<=9;a++) | ||
{ | ||
printf("%4d",a); | ||
} | ||
printf("\n"); | ||
for(a=1;a<=9;a++) | ||
{ | ||
printf("%4d",a); | ||
for(b=1;b<=a;b++) | ||
{ | ||
c=a*b; | ||
printf("%4d",c); | ||
} | ||
printf("\n"); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include<stdio.h> | ||
int jc(int a) | ||
{ | ||
int b=1,i; | ||
for(i=1;i<=a;i++) | ||
b*=i; | ||
return b; | ||
} | ||
void main() | ||
{ | ||
int x,y; | ||
printf("����������"); | ||
scanf("%d",&x); | ||
y=jc(x); | ||
printf("jc=%d",y); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
#include<stdio.h> | ||
main() | ||
{ | ||
int i; | ||
for(i=1;i<=10000;i++) | ||
printf("hello "); | ||
} | ||
|
||
|
||
|
||
#include<stdio.h> | ||
main() | ||
{ | ||
int a; | ||
for(a=2;a<=100;a=a+2) | ||
printf("%d ",a); | ||
} | ||
|
||
|
||
|
||
#include <stdio.h> | ||
void main() | ||
{ | ||
int a,b,c; | ||
printf("输入三个数:"); | ||
scanf("%d %d %d",&a,&b,&c); | ||
if(a>b) | ||
{ | ||
if(a>c) | ||
printf("最大的为%d",a); | ||
else | ||
printf("最大的为%d",c); | ||
} | ||
else | ||
{ | ||
if(b<c) | ||
printf("最大的为%d",c); | ||
else | ||
printf("最大的为%d",b); | ||
} | ||
} | ||
|
||
|
||
#include<stdio.h> | ||
main() | ||
{ | ||
int a; | ||
for(a=1;a<=100;a++) | ||
{ | ||
if(a%3==0&&a%5!=0) | ||
printf("%d\n",a); | ||
} | ||
} | ||
|
||
|
||
#include<stdio.h> | ||
void main() | ||
{ | ||
int a,b,k; | ||
const n=5; | ||
int i[n]; | ||
printf("请输入5个0-9的数:\n"); | ||
for(a=1;a<=n;a++) | ||
{ | ||
printf("i[%d]=",a); | ||
scanf("%d",&i[a]); | ||
} | ||
for(a=1;a<n;a++) | ||
for(b=1;b<=n-a;b++) | ||
if(i[b]>i[b+1]) | ||
{ | ||
k=i[b]; | ||
i[b]=i[b+1]; | ||
i[b+1]=k; | ||
} | ||
for(a=1;a<=n;a++) | ||
printf("%d\n",i[a]); | ||
} | ||
|
||
|
||
#include<stdio.h> | ||
int jc(int a) | ||
{ | ||
int b=1,i; | ||
for(i=1;i<=a;i++) | ||
b*=i; | ||
return b; | ||
} | ||
void main() | ||
{ | ||
int x,y; | ||
printf("输入整数:"); | ||
scanf("%d",&x); | ||
y=jc(x); | ||
printf("jc=%d",y); | ||
} | ||
|
||
|
||
#include<stdio.h> | ||
main() | ||
{ | ||
int n; | ||
printf("n的值为:"); | ||
scanf("%d",&n); | ||
int i,j,k; | ||
int a[n]={0}; | ||
for(i=1;i<=n;i++) | ||
{ | ||
printf("a[%d]:",i); | ||
scanf("%d",&a[i]); | ||
} | ||
for(i=1;i<=n-1;i++) | ||
for(j=1;j<n-i;j++) | ||
if(a[j]<a[j+1]) | ||
{ | ||
k=a[j]; | ||
a[j]=a[j+1]; | ||
a[j+1]=k; | ||
} | ||
for(i=1;i<=n;i++) | ||
printf("%d\t",a[i]); | ||
printf("\n"); | ||
} | ||
|
||
|
||
#include<stdio.h> | ||
double zj(float a,float b,float c) | ||
{ | ||
float d; | ||
if(a<b) | ||
{ | ||
d=a; | ||
a=b; | ||
b=d; | ||
if(a<c) | ||
d=a; | ||
a=c; | ||
c=d; | ||
} | ||
else | ||
{ | ||
if(a<c) | ||
d=a; | ||
a=c; | ||
c=d; | ||
} | ||
if(a*a==b*b+c*c) | ||
return printf("为直角"); | ||
else | ||
return printf("不为直角"); | ||
|
||
} | ||
|
||
void main() | ||
{ | ||
float x,y,z,m; | ||
printf("输入三边:\n"); | ||
scanf("%f%f%f",&x,&y,&z); | ||
m=zj(x,y,z); | ||
printf("%d",m); | ||
} | ||
|
||
|
||
|
||
#include<stdio.h> | ||
main() | ||
{ | ||
int a,b,c,d; | ||
printf(" *"); | ||
for(a=1;a<=9;a++) | ||
printf("%3d",a); | ||
printf("\n"); | ||
for(a=1;a<=9;a++); | ||
{ | ||
printf("%3d",a); | ||
for(b=1;b<=a;b++) | ||
{ | ||
c=a*b; | ||
printf("%3d",c); | ||
} | ||
printf("\n"); | ||
} | ||
|
||
#include<stdio.h> | ||
main() | ||
{ | ||
int a; | ||
for(a=1;a<+100;a++) | ||
if(a%7==0||a%10==7) | ||
printf("%d\n",a); | ||
} } | ||
|
||
|
||
#include <stdio.h> | ||
int main() | ||
{ | ||
int a; | ||
printf("输入年份:"); | ||
scanf("%d",&a); | ||
if(a%400==0||a%100!=0&&a%4==0) | ||
printf("a为闰年"); | ||
else | ||
printf("a不为闰年"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <stdio.h> | ||
main() | ||
{ | ||
printf("hello world,I am Guohu!"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include<stdio.h> | ||
main() | ||
{ | ||
int n; | ||
printf("n��ֵΪ:"); | ||
scanf("%d",&n); | ||
int i,j,k; | ||
int a[n]={0}; | ||
for(i=1;i<=n;i++) | ||
{ | ||
printf("a[%d]:",i); | ||
scanf("%d",&a[i]); | ||
} | ||
for(i=1;i<=n-1;i++) | ||
for(j=1;j<n-i;j++) | ||
if(a[j]<a[j+1]) | ||
{ | ||
k=a[j]; | ||
a[j]=a[j+1]; | ||
a[j+1]=k; | ||
} | ||
for(i=1;i<=n;i++) | ||
printf("%d\t",a[i]); | ||
printf("\n"); | ||
} |
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.
后缀名不对