Skip to content
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

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1461d81
Add files via upload
jinshayumi Feb 27, 2017
6e01ae9
Create L0,L1PART
jinshayumi Mar 1, 2017
70de778
hanoi
jinshayumi Mar 15, 2017
5bb6bc3
hanoi
jinshayumi Mar 15, 2017
ae78780
new level 1
jinshayumi Mar 27, 2017
bf52a24
changes
jinshayumi Mar 28, 2017
519c20b
Delete 1万你好.c
jinshayumi Mar 28, 2017
6d854d5
Delete 2到100偶数.c
jinshayumi Mar 28, 2017
4e60002
Delete 3个数.c
jinshayumi Mar 28, 2017
f430b3b
Delete 3整除5不整除.c
jinshayumi Mar 28, 2017
6fbf106
Delete 5个数.c
jinshayumi Mar 28, 2017
cc3cbb6
Delete 5个比大小.c
jinshayumi Mar 28, 2017
357654f
Delete 99.c
jinshayumi Mar 28, 2017
572c795
Delete JCC.c
jinshayumi Mar 28, 2017
5eb085c
Delete L0,L1PART
jinshayumi Mar 28, 2017
4ad7c70
Delete hello.c
jinshayumi Mar 28, 2017
43597b7
Delete n个大小.c
jinshayumi Mar 28, 2017
c3bad89
Delete n个数.c
jinshayumi Mar 28, 2017
fcd606b
Delete zj.c
jinshayumi Mar 28, 2017
dd81311
Delete 奇偶 13.c
jinshayumi Mar 28, 2017
8ce52ed
Delete 跟7有关.c
jinshayumi Mar 28, 2017
3851542
Delete 闰年.c
jinshayumi Mar 28, 2017
9b4a5b8
new level 0
jinshayumi Mar 28, 2017
4848cc1
maze
jinshayumi Apr 5, 2017
866acb7
fighter main
jinshayumi May 22, 2017
4009b32
Create fighter music
jinshayumi May 22, 2017
b96672c
Create fighter bullet
jinshayumi May 22, 2017
cb0845c
canvas
jinshayumi Jun 23, 2017
416439b
circuit
jinshayumi Jun 23, 2017
5d8eee0
point and circle
jinshayumi Jun 23, 2017
b787db5
queue
jinshayumi Jun 23, 2017
3aacdd1
Update fighter main
jinshayumi Jun 23, 2017
b828a32
bigboss
jinshayumi Jun 23, 2017
4528cdd
Create bigbullet
jinshayumi Jun 23, 2017
01cb96f
Create enemy
jinshayumi Jun 23, 2017
e972cca
Create gift
jinshayumi Jun 23, 2017
b47f338
Create smallboss
jinshayumi Jun 23, 2017
b785668
Create smallbullet
jinshayumi Jun 23, 2017
dda98ab
Create super skill
jinshayumi Jun 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions practices/c/level1/new level 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
#include <stdio.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码不要写在一个文件内;分成各自的c文件

#include <stdlib.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("add:1,decode:2:");
int choose;
scanf("%d",&choose);
if(choose==1)
{
char add[30],*a;
a=add;
printf("add:");
scanf("%s",add);
while(*a!='\0')
{
*a=*a+'B'-'m';
a++;
}
printf("%s",add);
}

else if(choose==2)
{
char decode[30],*b;
b=decode;
printf("decode:");
scanf("%s",decode);
while(*b!='\0')
{
*b=*b+'m'-'B';
b++;
}
printf("%s",decode);
}

else
{
printf("error");
}
return 0;
}



#include<stdio.h>
int main()
{
int life,tn,qn,ds,son;
printf("age may be:");
for(life=1;life++;life<=100)
{
tn=life/6;
qn=life/12;
ds=life/7;
son=life/2;

if(life==tn+qn+ds+5+son+4&&life%84==0)
{
printf("%d",life);
}
}
}



#include<stdio.h>
int main()
{
int a,b,c;
printf("primes from 2-1000:2\t");
for(a=3;a<=1000;a++)
{
c=0;
for(b=2;b<a;b++)
{
if(a%b!=0)
c++;
}
if(c==a-2)
{
printf("%d\t",a);
}
}
}



#include<stdio.h>
int sushu(int a)
{
int b, c=0;
for(b=2;b<a;b++)
{
if(a%b!=0)
c++;
}
if(c==a-2)
{
return 1;
}
else
{
return 0;
}
}

int main()
{
int i,j;
for(i=4;i<=100;i+=2)
{
for(j=2;j<=i/2;j++)
{
if(sushu(j)&&sushu(i-j))
printf("%d=%d+%d\t",i,j,i-j);
}
}
return 0;
}




#include<stdio.h>

void move(int n,int x,int y,int z)
{
if(n==1)
{
printf("%c->%c\n",x,z);
}
else
{
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');
}



#include<stdio.h>
int main()
{
int a,i,b;
b=0;
printf("print the letter:");
scanf("%d",&a);
for(i=2;i<a;i++)
{
if(a%i!=0)
b++;
}
if(b==a-2)
{
printf("a is prime");
}
else
{
printf("a isnt prime");
}
}



#include<stdio.h>
int main()
{
int shuixianhua,bai,shi,ge;
printf("the narcissus:");
for(shuixianhua=100;shuixianhua<1000;shuixianhua++)
{
bai=shuixianhua/100;
shi=(shuixianhua-100*bai)/10;
ge=shuixianhua%10;

if(shuixianhua==ge*ge*ge+shi*shi*shi+bai*bai*bai)
{
printf("%d\t",shuixianhua);
}
}
}



#include <stdio.h>
#include <windows.h>

int main()
{
int i,j;
for (i=0;i<31;i++)
{
system("cls");
for(j=0;j<i;j++)
{
printf(" ");
}
printf("a");
Sleep(100);
}

for(i =30;i>= 0;i--)
{
system("cls");
for(j=0; j<i;j++)
{
printf(" ");
}
printf("a");
Sleep(100);
}
}