Skip to content

Commit

Permalink
add kk's code
Browse files Browse the repository at this point in the history
  • Loading branch information
sihuan committed Oct 6, 2022
1 parent a42eedc commit e0054b7
Show file tree
Hide file tree
Showing 340 changed files with 17,760 additions and 0 deletions.
15 changes: 15 additions & 0 deletions QuestionAns/kk/1001.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdio.h>
int main()
{
printf("Hello Da_min,\nHello Er_min,\nHello Xiao_ming!\n");
return 0;
}
/**************************************************************
Problem: 1001
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:744 kb
****************************************************************/

18 changes: 18 additions & 0 deletions QuestionAns/kk/1002.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>
#include<math.h>
int main()
{
int x,y;
scanf("x = %d, y = %d",&x,&y);
printf("x + y : %d\nx - y : %d\nx * y : %d\nx / y quotient: %d, remainder: %d\nx ^ 2 : %.0lf\ny ^ 3 : %.0lf",x+y,x-y,x*y,x/y,x%y,pow(x,2),pow(y,3));

}
/**************************************************************
Problem: 1002
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:760 kb
****************************************************************/

20 changes: 20 additions & 0 deletions QuestionAns/kk/1003.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<stdio.h>
int main()
{
double r,s,c;
scanf("%lf",&r);
s=r*r*3.14;
c=2*r*3.14;

printf("Area: %lf\nPerimeter: %lf",s,c);

}
/**************************************************************
Problem: 1003
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

18 changes: 18 additions & 0 deletions QuestionAns/kk/1004.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>
int main()
{
int a,b,c;
double p;
scanf("%d%d%d",&a,&b,&c);
p=(a+b+c)/3.0;
printf("%.3lf",p);
}
/**************************************************************
Problem: 1004
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

19 changes: 19 additions & 0 deletions QuestionAns/kk/1006.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<stdio.h>
int main()
{
char a,b,c;
scanf("%c%c%c",&a,&b,&c);
printf("%03d %03o %03x\n",a,a,a);
printf("%03d %03o %03x\n",b,b,b);
printf("%03d %03o %03x\n",c,c,c);
}

/**************************************************************
Problem: 1006
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

16 changes: 16 additions & 0 deletions QuestionAns/kk/1007.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
(a%2==0)?printf("even"):printf("odd");
}
/**************************************************************
Problem: 1007
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

20 changes: 20 additions & 0 deletions QuestionAns/kk/1008.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int a;
double b;
scanf("%d%lf",&a,&b);
printf("%d\n",abs(a));
printf("%g",fabs(b));
}
/**************************************************************
Problem: 1008
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

17 changes: 17 additions & 0 deletions QuestionAns/kk/1010.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
if((a%4==0)&&(a%100!=0)||(a%400==0))printf("Yes");
else printf("No");
}
/**************************************************************
Problem: 1010
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

21 changes: 21 additions & 0 deletions QuestionAns/kk/1012.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include<stdio.h>
#include<math.h>
int main()
{
int m,a,b,c;
scanf("%d",&m);
a=m/100;
b=m%100/10;
c=m%10;
if(m==pow(a,3)+pow(b,3)+pow(c,3))printf("YES");
else printf("NO");
}
/**************************************************************
Problem: 1012
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:760 kb
****************************************************************/

24 changes: 24 additions & 0 deletions QuestionAns/kk/1013.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<stdio.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
b=100-a;
c=b/20;
d=(b%20)/10;
e=(b%10)/5;
f=b%5;
printf("$20 bills: %d\n",c);
printf("$10 bills: %d\n",d);
printf(" $5 bills: %d\n",e);
printf(" $1 bills: %d",f);
}
/**************************************************************
Problem: 1013
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

16 changes: 16 additions & 0 deletions QuestionAns/kk/1014.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>
int main()
{
int a,b,c;
scanf("(0%d)%d-%d",&a,&b,&c);
printf("0086%d%d%d",a,b,c);
}
/**************************************************************
Problem: 1014
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

23 changes: 23 additions & 0 deletions QuestionAns/kk/1015.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
unsigned long long int n,sum=0,i;
scanf("%llu",&n);
if(n%2==0)
sum=n/2*(n+1);
if(n%2!=0)
sum=(n+1)/2*n;
printf("%llu",sum);

}
/**************************************************************
Problem: 1015
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

18 changes: 18 additions & 0 deletions QuestionAns/kk/1016.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>
#include<math.h>
int main()
{
double x,y;
scanf("%lf",&x);
y=log(x)/log(2);
printf("%d",(int)y);
}
/**************************************************************
Problem: 1016
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:756 kb
****************************************************************/

40 changes: 40 additions & 0 deletions QuestionAns/kk/1018.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include<stdio.h>
int main()
{
int a,b,c,d,f;
scanf("%d%d%d",&a,&b,&c);
if((a<=100)&&(a>=0)&&(b<=100)&&(b>=0)&&(c<=100)&&(c>=0))
{


if(a>b)
{
f=a;
a=b;
b=f;
}
if(a>c)
{
f=a;
a=c;
c=f;
}
if(b>c)
{
f=b;
b=c;
c=f;
}
printf("%d %d %d",a,b,c);
}
else ;
}
/**************************************************************
Problem: 1018
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

29 changes: 29 additions & 0 deletions QuestionAns/kk/1019.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include<stdio.h>
int main()
{
int k,m,n,i;
scanf("%d%d%d",&k,&m,&n);
if(m!=n)
{
if(m>n)
i=n;
else i=m;
printf("%d",i);
i++;
while(i<=k)
{
if((i%m==0)&&(i%n!=0)||(i%n==0)&&(i%m!=0))
printf(" %d",i);
i++;
}
}
}
/**************************************************************
Problem: 1019
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

16 changes: 16 additions & 0 deletions QuestionAns/kk/1020.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF)
printf("%d\n",a+b);
}
/**************************************************************
Problem: 1020
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

21 changes: 21 additions & 0 deletions QuestionAns/kk/1021.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include<stdio.h>
int main()
{
int n,a,b,i=1;
scanf("%d",&n);
while(i<=n)
{
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
i++;
}
}
/**************************************************************
Problem: 1021
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

21 changes: 21 additions & 0 deletions QuestionAns/kk/1022.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include<stdio.h>
int main()
{
int a,b;
while(1)
{
scanf("%d%d",&a,&b);
if(a==0&&b==0)
break;
printf("%d\n",a+b);
}
}
/**************************************************************
Problem: 1022
User: 202001060117
Language: C
Result: Accepted
Time:0 ms
Memory:748 kb
****************************************************************/

Loading

0 comments on commit e0054b7

Please sign in to comment.