top of page
게시판 게시물
kimgeon7635
2021년 6월 23일
In 소스 코드 제출
/* #include <stdio.h> int main () { int i,j; int arr[10][10]; for (i=0; i<=9; i++) for (j=0; j<=9; j++) scanf ("%d",&arr[i][j]); i=1; j=1; while(1) { if (arr[i][j]==0) { arr[i][j]=9; } else if(arr[i][j]==2) { arr[i][j]=9; break; } if (arr[i][j+1]!=1) { j++; } else if(arr[i+1][j]!=1) { i++; } else { break; } } for (i=0; i<=9; i++) { for (j=0;j<=9;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int a,b,y,m,d; scanf ("%d-%d",&a,&b); b=b/1000000; y=a/10000; m=(a/100)%100; d=a%100; if (b==1 ||b==2) { printf ("19"); } else { printf ("20"); } printf ("%02d/%02d/%02d",y,m,d); if(b==1||b==3) { printf (" M"); } else { printf (" F"); } return 0; } */ /* #include <stdio.h> int main () { int n,i=0,j; int arr[40]; scanf ("%d",&n); while (n>=0) { if (n/2!=0) { arr[i]=n%2; n=n/2; i++; } else { arr[i]=n; break; } } for (j=i;j>=0;j--) { printf ("%d",arr[j]); } return 0; } */ /* #include <stdio.h> #include <string.h> int main () { char str[91]; int arr[26]={},i,k; gets(str); for (i=0;str[i]!=0;i++) { arr[str[i]-97]++; } for (i=0;i<=25;i++) { printf ("%c:%d\n",i+97,arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int m,n,i,sum=0,t=0; scanf ("%d %d",&m,&n); while (t*t<m) { t++; } for (i=t;i*i<=n;i++) { sum=sum+i*i; } if (sum==0) { printf ("-1"); } else { printf ("%d\n%d",sum,t*t); } return 0; } */ /* #include <stdio.h> int main () { int i=0,n; scanf ("%d",&n); while (i*i<n) { i++; } i--; printf ("%d %d",n-i*i,i); return 0; } */ #include <stdio.h> int main () { int m,n,i; scanf ("%d %d",&m,&m); for (i=m;i<=n;i++) { for (j=1;j<=i;j++) { if (i/j) } } }
0
0
1
kimgeon7635
2021년 5월 19일
In 소스 코드 제출
/* #include <stdio.h> int main () { long long int a; int m,d,n,i; scanf ("%lld %d %d %d",&a,&m,&d,&n); for (i=1;i<n;i++) { a=a*m+d; } printf("%lld",a); return 0; } */ /* #include <stdio.h> int main () { int n; scanf ("%d",&n); if (n>=30&&n<=40||n>=60&&n<=70) { printf ("win"); } else { printf ("lose"); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); if ((a-b+c)%10==0) { printf ("대박"); } else { printf ("그럭저럭"); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); if ((((a+b+c)/100)%10)%2==0) { printf ("대박"); } else { printf ("그럭저럭"); } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); if (b%a==0) { printf ("%d*%d=%d",a,b/a,b); } else if (a%b==0) { printf ("%d*%d=%d",b,a/b,a); } else { printf ("none"); } return 0; } */ /* #include <stdio.h> int main () { int i,min=1000000,max=-1000000,a; for (i=0;i<=4;i++) { scanf ("%d",&a); if (a>max) { max=a ; } if (a<min) { min=a; } } printf ("%d \n%d",max,min); return 0; } */ /* #include <stdio.h> int main () { int n,i,j; scanf ("%d",&n); for (i=1;i<=n;i++) { for (j=1;j<i;j++) { printf (" "); } for (j=1;j<=2;j++) { printf ("*"); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,h,r,a; scanf ("%d %d",&h,&r); for (a=1; a<=r; a++) { for (i=1; i<=h; i++) { for (j=1; j<i; j++) { printf (" "); } printf ("*"); printf ("\n"); } for (i=1; i<h; i++) { for (j=1; j<=h-i-1; j++) { printf (" "); } printf ("*"); printf ("\n"); } } return 0; } */ /* #include <stdio.h> int main () { int i,j,a[11][10]={}; for (i=0;i<11;i++) { for (j=0;j<10;j++) { scanf ("%d",&a[i][j]); } } for (j=0;j<10;j++) { if (a[10][j]==1) { for (i=9;i>=0;i--) { if (a[i][j]>0) { printf ("%d crash\n",j+1); break; } else if (a[i][j]<0) { printf ("%d fall\n",j+1); break; } else if (i==0) { printf ("%d safe\n",j+1); } } } } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d-%d",&a,&b); if (b/1000000==1) { printf ("19%d/%d/%d M",a/10000,(a/100)%100,a%100); } else if (b/10000000==2) { printf ("19%d/%d/%d F",a/10000,(a/100)%100,a%100); } else if (b/10000000==3) { printf ("20%d/%d/%d M",a/10000,(a/100)%100,a%100); } else if (b/10000000==4) { printf ("20%d/%d/%d F",a/10000,(a/100)%100,a%100); } return 0; } */ /* #include <stdio.h> int main () { int a,sum=0,min=100,i; for (i=1;i<=7;i++) { scanf ("%d",&a); if (a%2==1) { sum=sum+a; if (a<min) { min=a; } } } if (sum==0) { printf ("-1"); } printf ("%d \n%d",sum,min); return 0; } */ /* #include <stdio.h> int main () { int a,b,c,d,i; scanf ("%d %d %d %d",&a,&b,&c,&d); c=c+d; if (c>60) { b=b+c/60; c=c%60; } if (b>60) { a=a+b/60; b=b%60; } for (i=1; ;i++) { if (a>24) { a=a-24; } else { break; } } printf ("%d %d %d",a,b,c); } */ /* #include <stdio.h> #include <string.h> int main () { int a=10,i; char str[51]={}; gets (str); for (i=1;i<strlen(str);i++) { if (str[i]==str[i-1]) { a+=5; } else { a+=10; } } printf ("%d",a); return 0; } */ #include <stdio.h> int main () { int n; scanf ("%d",&n); }
0
0
2
kimgeon7635
2021년 3월 27일
In 소스 코드 제출
/* #include <stdio.h> #define SIZE 100001 #include <string.h> int stack [SIZE]={}; int top=-1; void push (int data) { stack [++top]=data; } int pop () { return stack [top--]; } int main () { int i,sum=0,j,len; char str[SIZE]; gets (str); len=strlen(str); for (i=0;i<len;i++) { if (str[i]=='(') { push (1); } else { pop (); if(str[i-1]=='(') { sum+=top+1; } else { sum++; } } } printf ("%d",sum); return 0; } */ /* #include <stdio.h> #define SIZE 201 #include <string.h> int stack[SIZE]= {}; int top=-1; void push (int data) { stack[++top]=data; } int pop () { return stack [top--]; } int main () { int i,len,a=0,b=0,j,num=0; char str[SIZE]; gets(str); len=strlen(str); for (i=0; i<len; i++) { if (str[i]=='+') { b=pop(); a=pop(); push (a+b); } else if (str[i]=='*') { b=pop(); a=pop(); push (a*b); } else if (str[i]=='-') { b=pop(); a=pop(); push (a-b); } else if (str[i]!=' ') { num=num*10+str[i]-'0'; if(str[i+1]==' ') { push(num); num=0; } } } printf ("%d",pop()); return 0; } */ #include <stdio.h> int main () { int i; double a,b,sum=0,money; for (i=1;i<=5;i++) { scanf ("%lf %lf",&a,&b); if(b-a>=1&&b-a<=5) { sum+=b-a-1; } else if (b-a>=5) { sum+=4; } } if (sum>=15) { money=sum*10000*0.95; } else if (sum<=5) { money=sum*10000*1.05; } else { money=sum*10000; } printf ("%d",(int)money); return 0; }
0
0
1
kimgeon7635
2021년 3월 24일
In 소스 코드 제출
/* #include <stdio.h> #define SIZE 201 int stack [SIZE]={}; int top=-1; void push (int data) { stack [++top]=data; } int pop () { if(top==-1) return 0; return stack [top--]; } void empty() { if(top==-1) printf("true\n"); else printf("false\n"); } int main () { int n,i,j,c=0,a=0; char str[SIZE]; scanf ("%d ",&n); for (i=0;i<n;i++) { gets(str); if(str[1]=='u') { for (j=6;str[j]!=' ';j++) { a=a*10+str[j]-'0'; } push (a); a=0; } else if(str[0]=='t') { if(top==-1) printf("-1\n"); else printf ("%d\n",stack[top]); } else if (str[2]=='p'&&str[0]=='p') { pop (); } else if (str[0]=='s') { printf ("%d\n",top+1); } else if(str[0]=='e') { empty(); } } return 0; } */ /* #include <stdio.h> #define SIZE 201 #include <string.h> int stack[SIZE]={}; int top=-1; void push (int data) { stack [++top]=data; } int pop { return stack[top--]; } int main () { char str[SIZE]; gets (str); for (i=1;i<strlen(str);i+2) { if (str[i]=='*'||str[i]=='+'||str[i]=='-') { str[i]\\ } #include <stdio.h> #define SIZE 201 #include <string.h> int stack[SIZE]={}; int top=-1; void push (int data) { stack [++top]=data; } int pop { return stack[top--]; } int main () { char str[SIZE]={}; gets (str); for (i=0;i<strlen(str);i++) { } } */ /* basic queue #include <stdio.h> #define SIZE 5 int queue[SIZE]={}; int front=-1,rear=-1; void enqueue (int data) { if (rear==SIZE-1) { printf("queue is full!!\n"); return ; } queue [++rear]=data; } int dequeue() { int data; if (front==rear) { printf("queue is empty!!\n"); return 0; } front++; data=queue[front]; queue[front]=0; printf("deq data is %d\n",data); return data; } void view() { printf("-------------------------\n"); for(int i=front+1;i<=rear;i++) { printf("%d ",queue[i]); } printf("\n-----------------------\n"); } */ //circular queue #include <stdio.h> #define SIZE 5 int queue[SIZE]={}; int front=0,rear=0; void enqueue (int data) { if((rear+1)%SIZE==front) { printf("queue is full!!\n"); return ; } rear=(rear+1)%SIZE; queue [rear]=data; } int dequeue() { int data; if (front==rear) { printf("queue is empty!!\n"); return 0; } front=(front+1)%SIZE; data=queue[front]; queue[front]=0; printf("deq data is %d\n",data); return data; } void view() { printf("-------------------------\n"); for(int i=0;i<SIZE;i++) { printf("%d ",i); } printf("\n"); for(int i=0;i<SIZE;i++) { printf("%d ",queue[i]); } printf("\n-----------------------\n"); } int main() { int n, c; while(1) { printf("1.enq 2.deq 3.view >>"); scanf("%d",&n); if(n==1) { printf("enq data is "); scanf("%d",&c); enqueue(c); view(); } else if(n==2) { dequeue(); view(); } else { view(); } } }
0
0
2
kimgeon7635
2021년 3월 20일
In 소스 코드 제출
/* #include <stdio.h> #define SIZE 100000 int stack [SIZE]={}; int top=-1; void push (int data) { stack[++top]=data; } int pop () { return stack [top--]; } int main () { int k,a=0,i,sum=0; scanf ("%d",&k); for (i=1;i<=k;i++) { scanf ("%d",&a); if(a==0) { pop(); } else { push(a); } } k=top+1; for(i=0;i<k;i++) { sum+=pop(); } printf("%d",sum); return 0; } */ /* #include <stdio.h> #define SIZE 50001 #include <string.h> int stack [SIZE]={}; int top=-1; void push (int data) { stack [++top]=data; } int pop () { return stack [top--]; } int main () { int i; char str[SIZE]; gets (str); for (i=0;i<strlen(str);i++) { if (str[i]==')') { pop (); if (top==-2) { break; } } else { push (str[i]); } } if (top==-1) { printf ("good"); } else { printf ("bad"); } return 0; } */ #include <stdio.h> #define SIZE 200 int stack [SIZE]={}; int top=-1; void push (int data) { stack [++top]=data; } int pop () { return stack [top--]; } int main () { int n,i,j,c=0; char str[SIZE]; scanf ("%d ",&n); for (i=0;i<n;i++) { gets(str); if(str[1]=='u') { push (c); } else if(str[0]=='t') { printf ("%d\n",pop()); } else if (str[2]=='p'&&str[0]=='p') { pop (); } else if (str[0]=='s') { } return 0; }
0
0
2
kimgeon7635
2021년 3월 13일
In 소스 코드 제출
/* #include <stdio.h> #define SIZE 200 #include <string.h> char stack [SIZE]={}; int top=-1; void push (int data) { stack[++top]=data; } int pop () { return stack [top--]; } int main () { int i,n; char str[SIZE]={}; scanf ("%d ",&n); for (i=n-1;i>=0;i--) { scanf ("%c",&str[i]); } for (i=0;i<n;i++) { if (i%3==0&&i!=0) { push (','); } push (str[i]); } n=top+1; for (i=0;i<n;i++) { printf ("%c",pop()); } return 0; } */ /* #include <stdio.h> #define SIZE 100 #include <string.h> char stack [SIZE]={}; int top=-1; void push (char data) { stack [++top]=data; } char pop () { return stack [top--]; } int main () { int i; char str1[SIZE]={},str2[SIZE]={}; int str3[500]={}; int la,lb,k,lc; gets (str1); gets (str2); la=strlen(str1); lb=strlen(str2); for (i=la-1;i>=0;i--) { str3[la-i-1]=str1[i]-'0'; } for (i=strlen(str2)-1;i>=0;i--) { str3[lb-i-1]+=str2[i]-'0'; } lc=la>lb?la:lb; for (i=0;i<lc;i++) { if (str3[i]>=10) { str3[i+1]+=str3[i]/10; } push(str3[i]%10+'0'); } if(str3[i]!=0) push(str3[i]+'0'); k=top+1; for (i=0;i<k;i++) { printf ("%c",pop()); } return 0; } */ /* #include <stdio.h> #define SIZE 100 int stack [SIZE]={}; int top=-1; void push (int data) { stack[++top]=data; } int pop () { return stack [top--]; } int main () { int k,a=0,i,sum=0; scanf ("%d",&k); for (i=1;i<=k;i++) { scanf ("%d",&a); if(a==0) { pop(); } else { push(a); } } k=top+1; for(i=0;i<k;i++) { sum+=pop(); } printf("%d",sum); } */
0
0
3
kimgeon7635
2021년 3월 10일
In 소스 코드 제출
/* #include <stdio.h> int main () { int n,arr[101]={},i,sum=0; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&arr[i]); } for (i=1;i<=n;i++) { if (arr[i]!=0&&arr[i-1]!=0) { arr[i]=arr[i-1]+1; } } for (i=1;i<=n;i++) { sum=sum+arr[i]; } printf ("%d",sum); return 0; } */ /* #include <stdio.h> long long int n; long long int f(long long int n) { long long int a=0; while (n!=0) { a=a*10+n%10; n=n/10; } return a; } int main() { scanf("%lld", &n); printf("%lld\n", f(n)); } */ /* #include <stdio.h> int a[10001]; int n, i, j, temp, key; int main() { scanf("%d", &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); for (i=2; i<=n; i++) { key=a[i]; for(j=i-1;j>=1&&key<a[j];j--) { a[j+1]=a[j]; } a[j+1]=key; } for (i=1; i<=n; i++) printf("%d\n", a[i]); return 0; } */ /* #include <stdio.h> int main () { int i,temp,a[4],j; for (i=1;i<=3;i++) { scanf ("%d",&a[i]); } for (i=1;i<3;i++) { for (j=1;j<=3-i;j++) { if (a[j]>a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } } for (i=1;i<=3;i++) { printf ("%d ",a[i]); } return 0; } */ /* #include <stdio.h> int a[10001]; int n, i, j, temp, min; int main() { scanf("%d", &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); for (i=1; i<n; i++) { min=i; for (j=i+1; j<=n; j++) { if (a[j]<a[min]) { min=j; } } temp = a[i]; a[i] = a[min]; a[min] = temp; } for (i=1; i<=n; i++) printf("%d\n", a[i]); return 0; } */ /* #include <stdio.h> int main () { int a[4],i,j,min,temp; for (i=1;i<=3;i++) { scanf ("%d",&a[i]); } for (i=1;i<3;i++) { min=i; for (j=i+1;j<=3;j++) { if (a[j]<a[min]) { min=j; } } temp=a[i]; a[i]=a[min]; a[min]=temp; } for (i=1;i<=3;i++) { printf ("%d ",a[i]); } return 0; } */ /* #include <stdio.h> #define SIZE 5 int stack[SIZE]={}; int top=-1; //데이터가 마지막으로 저장된 위치 void push(int data) { stack[++top]=data; } int pop() { return stack[top--]; } */ /* #include <stdio.h> #define SIZE 50 int stack[SIZE]={}; int top=-1; void push (int data) { stack[++top]=data; } int pop () { return stack [top--]; } int main () { int n,i; char str[50]={}; scanf ("%s",str); for(i=0;i<strlen(str);i++) { push(str[i]-'0'); } for (i=0;i<strlen(str);i++) { printf ("%d",pop()); } return 0; } */ #include <stdio.h> #define SIZE 200 #include <string.h> int stack [SIZE]={}; int top=-1; void push (int data) { stack[++top]=data; } int pop () { return stack [top--]; } int main () { int i,n; char str[SIZE]={}; scanf ("%d",&n); for (i=1; ;i++) { if (n%3==0) { str[i]=','; } else { str[i]=n%10; n=n/10; } } for (i=1;i<strlen(str);i++) { push (str[i]); } for (i=1;i<strlen(str);i++) { printf ("%c",pop()); } }
0
0
3
kimgeon7635
2021년 3월 06일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } #include <stdio.h> struct student { char name [11]; int grade; }; int main () { struct student st[51]; int n,mi=1,i,j; scanf ("%d",&n); for (i=1; i<=n; i++) { scanf ("%s %d",st[i].name,&st[i].grade); } for (i=1; i<=3; i++) { for (j=1; j<=n; j++) { if (st[j].grade>st[mi].grade) { mi=j; } } if(i==3) { printf("%s\n",st[mi].name); } st[mi].grade=0; mi=1; } } #include <stdio.h> struct gas { int number,gas; }; int main () { struct gas st[101]; int n,i; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d %d",&st[i].number,&st[i].gas); } for (i=1;i<=n;i++) } */ /* #include <stdio.h> typedef struct { int c, n, s; }student; int main() { student st[100]; int i, j, num,mi=1,temp; scanf("%d",&num); for(i=1;i<=num;i++) { scanf("%d %d %d",&st[i].c,&st[i].n,&st[i].s); } for (i=1;i<=num;i++) { for (j=1;j<=num;j++) { if (st[j].s>st[mi].s) { mi=j; } } temp=st[i]; st[i]=st[mi]; st[mi]=temp; } printf ("%d %d %d",st[i].c,st[i].n,st[i].s); } */ /* #include <stdio.h> typedef struct { int n; int g; }gas; int main () { int num,i,j,min; gas st[101],temp; scanf ("%d",&num); for (i=1;i<=num;i++) { scanf ("%d %d",&st[i].n,&st[i].g); } for (i=1;i<num;i++) { min=i; for (j=i+1;j<=num;j++) { if (st[j].n<st[min].n) { min=j; } } temp = st[i]; st[i]=st[min]; st[min]=temp; } for (i=1;i<=num;i++) { printf ("%d %d\n",st[i].n,st[i].g); } return 0; } */ /* #include <stdio.h> int a[10001]; int n, i, j, temp; int main() { scanf("%d", &n); for (i=1; i<=n; i++) scanf("%d", &a[i]); for(i=1; i<n; i++) { for (j=1;j<=n-i;j++) { if (a[j] > a[j+1]) { temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; } } } for (i = 1; i <= n; i++) printf("%d\n", a[i]); return 0; } */ /* #include <stdio.h> float a[1001],temp; int n,i,j,c=0; int main () { scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%f",&a[i]); } for (i=1;i<=n;i++) { c=0; for (j=1;j<=n-i;j++) { if (a[j]>a[j+1]) { c=1; temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } if(c==0) { printf ("%d",i-1); break; } } return 0; } */ /* 2 -1 -3 1 #include <stdio.h> int main () { int n,i,rev=0,sum=0; scanf ("%d",&n); while(n>0) { sum+=n%10; rev=rev*10+n%10; n=n/10; } printf ("%d\n%d",rev,sum); return 0; } */ #include <stdio.h> int main () { int n,i,temp,arr[101],j; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&arr[i]); } for (i=1;i<n;i++) { for (j=1;j<=n-i;j++) { if (arr[j]<arr[j+1]) { temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } for (i=1;i<=n;i++) { printf ("%d ",arr[i]); } return 0; }
0
0
4
kimgeon7635
2021년 3월 03일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> struct student { int age; char grade; double score; }; int main() { struct student st[100]; scanf("%d",&st[i].age); return 0; } */ /* #include <stdio.h> struct student { char name[11]; int score1,score2,score3; }; int main () { int n,i,mi=1,a=1,b=1; struct student st[101]; scanf ("%d",&n); for (i=1; i<=n; i++) { scanf ("%s %d %d %d",st[i].name,&st[i].score1, &st[i].score2,&st[i].score3); if (st[i].score1>st[mi].score1) { mi=i; } } for(i=1;i<=n;i++) { if (st[mi].score2<st[i].score2) { a++; } if (st[mi].score3<st[i].score3) { b++; } } printf ("%s %d %d",st[mi].name,a,b); } */ /* #include <stdio.h> struct student { int score,rank; }; int main () { int n,j,i; struct student st[201]; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&st[i].score); st[i].rank=1; } for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { if (st[i].score<st[j].score) { st[i].rank++; } } printf ("%d %d\n",st[i].score,st[i].rank); } return 0; } */ /* #include <stdio.h> struct student { char name[11]; int grade; }; int main () { struct student st[101]; int n,m,i,j,mi=1; scanf ("%d %d",&n,&m); for (i=1;i<=n;i++) { scanf ("%s %d",st[i].name,&st[i].grade); } for (i=1;i<=m;i++) { for (j=1;j<=n;j++) { if (st[mi].grade<st[j].grade) { mi=j; } } printf ("%s\n",st[mi].name); st[mi].grade=0; mi=1; } return 0; } */ #include <stdio.h> int a[10001]; int n, i, j, temp, min; int main() { scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &a[i]); } for (i=1; i<n; i++) { min=i; for (j=i+1; j<=n; j++) { if (a[j]<a[min]) { a[i]=min } } temp = a[i]; a[i] = a[min]; a[min] = temp; } for (i=1; i<=n; i++) printf("%d\n", a[i]); return 0; }
0
0
6
kimgeon7635
2021년 2월 25일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } */ /* #include <stdio.h> long long int n; long long int f(long long int n) { int i; long long int a=0,b=0; for (i=0; ;i++) { if (a!=0||n/10!=0) { a=n%10; n/=10; b=b*10+a; } } return b; } int main() { scanf("%lld", &n); printf("%lld\n", f(n)); } */ /* #include <stdio.h> int a, n; long long int pow(int a, int n) { int i; long long int c=1; if(a==1) return 1; for (i=1;i<=n;i++) { c=c*a; } return c; } int main() { scanf("%d%d", &a, &n); printf("%lld\n", pow(a, n)); } */ /* #include <stdio.h> int main () { int i,sum=0; scanf ("%d",&n); for (i=1; ;i++) { if (n!=0) { sum=sum+n%10; n/10; } } } } */ /* #include <stdio.h> int n; void rec (int n) { if (n==0) { return ; } rec (n/2); printf ("%d",n%2); } int main () { scanf ("%d",&n); if (n==0) { printf ("0"); } rec(n); } */ /* #include <stdio.h> int n; void rec (int n) { if (n==1) { printf ("1\n"); return ; } if (n%2!=0) { rec(3*n+1); } else { rec (n/2); } printf ("%d\n",n); } int main () { scanf ("%d",&n); rec(n); } */ #include <stdio.h> int n; void rec (int n) { if (n==0) { return ; } rec(n-1); star(n); } void star(int n) { if(n==0 ) { printf("\n"); return; } printf("*"); star(n-1); } int main () { scanf ("%d",&n); rec(n); }
0
0
2
kimgeon7635
2021년 2월 23일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } */ /* #include <stdio.h> #include <string.h> int main () { int i; char str[201]; gets (str); for (i=0;i<strlen(str);i++) { if (str[i]!=' ') { str[i]=str[i]-3; if (str[i]<97) { str[i]=122-97+str[i]+1; } } } printf ("%s",str); return 0; } #include <stdio.h> #include <string.h> int main () { int i; char str[1001]; gets (str); for (i=0;i<strlen(str);i++) { if (str[i]!=' ') { str[i]=str[i]+'q'-'n'; if (str[i]>122) { str[i]=str[i]+'z'-'a'-1; } } } printf("%s",str); return 0; } */ /* #include <stdio.h> #include <string.h> int main () { int i; char str[1001]; gets (str); for (i=0;i<strlen(str);i++) { if (str[i]>='a'&&str[i]<='w') { str[i]=str[i]+3; } else if (str[i]>='x'&&str[i]<='z') { str[i]=str[i]-23; } } printf ("%s",str); return 0; } */ /* #include <stdio.h> int a, b; #include <stdio.h> int a, b; int gcd (int a, int b) { int c=a>b?b:a; for (int i=c;i>=1 ;i--) { if (a%i==0&&b%i==0) { return i; } } } int main() { scanf("%d%d", &a, &b); printf("%d\n", gcd(a, b)); } */ /* #include <stdio.h> int n, a, b, d[1010]; int maxi (int a,int b) { int max=d[a],mi=a,i; for (i=a;i<=b;i++) { if (max<d[i]) { max=d[i]; mi=i; } } return mi; } int main() { scanf("%d", &n); for(int i=1; i<=n; i++) scanf("%d", &d[i]); scanf("%d%d", &a, &b); printf("%d\n", maxi(a, b)); } */ /* #include <stdio.h> int n, k, d[1010]; int lower_bound (int k) { for (int i=1;i<=n;i++) { if (d[i]>=k) { return i; } } return n+1; } int main() { scanf("%d", &n); for(int i=1; i<=n; i++) scanf("%d", &d[i]); scanf("%d", &k); printf("%d\n", lower_bound(k)); } */ /* #include <stdio.h> double n; double abs(double n) { if (n<0) { n=-n; } return n; } int main () { scanf ("%lf",&n); printf ("%.10g",abs(n)); return 0; } 1569 1557 */ /* #include <stdio.h> int n, k, d[1010]; int findi(int k) { for (int i=1;i<=n;i++) { if (d[i]==k) { return i; } } return -1; } int main() { scanf("%d", &n); for(int i=1; i<=n; i++) scanf("%d", &d[i]); scanf("%d", &k); printf("%d\n", findi(k)); } */ /* #include <stdio.h> int n; int f(int n) { int a=0; for (int i=1;i<=n;i++) { if (n%i==0) { a++; } } return a; } int main() { scanf("%d", &n); printf("%d\n", f(n)); } */ //재귀함수 recursive function 순환함수 //함수 내에서 자기 자신(함수)을 다시 호출하는 함수 /* void rec(int n) { if(n==0) return ; //종료조건 rec(n-1); printf("%d ",n); } int main() { rec(3); } */ /* #include <stdio.h> int n; void rec (int a) { printf ("%d\n",a); if (a==n) { return ; } rec(a+1); } int main () { scanf ("%d",&n); rec(1); return 0; } */ /* #include <stdio.h> int n; void rec (int n) { printf ("%d\n",n); if (n==1) { return ; } rec (n-1); } int main () { scanf ("%d",&n); rec (n); } */ /* #include <stdio.h> int a,b; void rec (int a) { if (a%2==1) { printf ("%d ",a); } if (a==b) { return ; } rec (a+1); } int main () { scanf ("%d %d",&a,&b); rec (a); return 0; } */ /* #include <stdio.h> int n; void rec(int n) { printf ("%d\n",n); if (n==1) { return ; } if (n%2==1) { rec(3*n+1); } else { rec (n/2); } } int main () { scanf ("%d",&n); rec (n); } */ /* #include <stdio.h> int n; int rec (int n) { if(n==1) { return 1; } return n+rec(n-1); } int main () { scanf ("%d",&n); printf ("%d",rec(n)); } */ /* #include <stdio.h> int n; int rec (int n) { if (n==1) { return 1; } return n*rec(n-1); } int main () { scanf ("%d",&n); printf ("%d",rec(n)); } */ /* #include <stdio.h> int n; int rec (int n) { if (n==1) { return 1; } if (n==2) { return 1; } return rec(n-1)+rec(n-2); } int main () { scanf ("%d",&n); printf ("%d",rec(n)); } */ #include <stdio.h> int n; void rec (int n) { if (n==0) { return ; } rec (n/2); printf ("%d",n%2); } int main () { scanf ("%d",&n); rec(n); } /* #include <stdio.h> int n; int rec (int n) { return rec(n-1)* } int main () { scanf ("%d",&n) printf ("%d".rec(n)); } */
0
0
2
kimgeon7635
2021년 2월 16일
In 소스 코드 제출
/* #include <stdio.h> int main () { int a,b,c,n,i; scanf ("%d %d %d",&a,&b,&c); n=b+c; for (i=1; ;i++) { if (n>=60) { a=a+1; n-60; } if (a>=24) { a=a-24; } } printf ("%d %d",&a,&n); return 0; }*/ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); a=(a+(b+c)/60)%24; b=(b+c)%60; printf ("%d %d",a,b); return 0; } */ /* #include <stdio.h> int main () { int w,h,n,d,x,y,l,arr[101][101]={},i,j; scanf ("%d %d %d",&h,&w,&n); for (i=1;i<=n;i++) { scanf ("%d %d %d %d",&l,&d,&x,&y); if (d==0) { for (j=0;j<l;j++) { arr[x][y+j]=1; } } else { for (j=0;j<l;j++) { arr[x+j][y]=1; } } } for (i=1;i<=h;i++) { for (j=1;j<=w;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int n,i,j,arr[21][21]={}; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&arr[i][1]); } for (i=2; i<=n;i++) { for(j=2;j<=i;j++) { arr[i][j]=arr[i][j-1]-arr[i-1][j-1]; } } for (i=1;i<=n;i++) { for (j=1;j<=i;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,arr[11][11]= {},r,c,s=0; for (i=1; i<=9; i++) { for (j=1; j<=9; j++) { scanf ("%d",&arr[i][j]); } } scanf ("%d %d",&r,&c); if (arr[r][c]==0) { s=arr[r][c-1]+arr[r][c+1]+arr[r-1][c-1]+arr[r-1][c]+arr[r-1][c+1]+arr[r+1][c-1]+arr[r+1][c]+arr[r+1][c+1]; printf ("%d",s); } else { printf ("-1"); } return 0; } */ /* #include <stdio.h> int main () { int arr[27][27]={},i,j,s,b[27][27]={}; for (i=1;i<=25;i++) { for (j=1;j<=25;j++) { scanf ("%d",&arr[i][j]); } } for (i=1;i<=25;i++) { for (j=1;j<=25;j++) { s=arr[i-1][j-1]+arr[i-1][j]+arr[i-1][j+1]+arr[i][j-1]+arr[i][j+1]+arr[i+1][j-1]+arr[i+1][j]+arr[i+1][j+1]; if (arr[i][j]==0) { if (s==3) { b[i][j]=1; } else { b[i][j]=0; } } else { if (s>=4||s<=1) { b[i][j]=0; } else { b[i][j]=1; } } } } for (i=1;i<=25;i++) { for (j=1;j<=25;j++) { printf ("%d ",b[i][j]); } printf ("\n"); } return 0; } /* #include <stdio.h> #include <string.h> int main () { char str; scanf ("%c",&str); printf ("%c",str); } */ /* #include <stdio.h> #include <string.h> int main () { char str[9]; scanf ("%s",str); printf ("%s",str); return 0; } /* #include <stdio.h> #include <string.h> int main () { char str[31]; gets (str); printf ("%s",str); return 0; } */ /* #include <stdio.h> #include <string.h> int main () { char str[30]; scanf ("%s",str); if (str[0]=='l'&&str[1]=='o'&&str[2]=='v'&&str[3]=='e'&&str[4]=='\0') { printf ("I love you."); } return 0; } */ /* #include <stdio.h> #include <string.h> int main () { int i; char str[101]; gets (str); for (i=0;i<strlen(str);i++) { if (str[i]!=' ') { printf ("%c",str[i]); } } return 0; } */ /* #include <stdio.h> #include <string.h> int main () { int i,a=0,b=0; char str[100001]; scanf ("%s",str); for (i=0;i<strlen(str);i++) { if (str[i]=='(') { a++; } else { b++; } } printf ("%d %d",a,b); } */ /* #include <stdio.h> #include <string.h> int main () { int i,a=0; char str[101]; gets (str); for (i=0;i<strlen (str);i++) { if (str[i]=='l'&&str[i+1]=='o'&&str[i+2]=='v'&&str[i+3]=='e') { a++; } } printf ("%d",a); } */
0
0
8
kimgeon7635
2021년 2월 04일
In 소스 코드 제출
/* #include <stdio.h> int main () { int i,arr[6]={},sum=0,n; scanf ("%d",&n); for (i=0;i<=6;i++) { arr[i]=n%10; n=n/10; } for (i=0;i<=6;i++) { if (arr[i]!=0) { printf ("%d",arr[i]); } } for (i=0;i<=6;i++) { sum=sum+arr[i]; } printf ("\n%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,a,max=1,mi=1; for (i=1;i<=9;i++) { scanf ("%d",&a); if(max<a) { max=a; mi=i; } } printf("%d\n%d",max,mi); return 0; } */ /* int main () { int arr[1000]={},i,n,k; scanf ("%d",&n); for (i=0;i<n;i++) { scanf ("%d",&k); arr[k] } for (i=n-1;i>=0;i--) { printf ("%d ",arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int arr[24]={},i,k,n; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&k); arr[k]++; } for (i=1;i<=23;i++) { printf ("%d ",arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int i,n,min=23,a; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&a); if (min>a) { min=a; } } printf ("%d",min); } */ /* #include <stdio.h> int main () { int i,n,arr[24]={},k; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&k); arr[k]++; } for (i=1;i<=23;i++) { if (arr[i]!=0) { printf ("%d",i); break; } } return 0; } */ /* #include <stdio.h> int main () { int n,m,i,arr[10000001]={},k,a; scanf ("%d",&n); for (i=1; i<=n; i++) { scanf ("%d",&k); arr[k]=1; } scanf ("%d",&m); for (i=1; i<=m; i++) { scanf ("%d",&a); printf ("%d ",arr[a]); } return 0; } */ /* #include <stdio.h> int main () { int i,j,arr[100][100]={},n,k=1; scanf ("%d",&n); for (j=1;j<=n;j++) { for (i=1;i<=n;i++) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { printf("%d ",arr[i][j]); } printf("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,n,arr[100][100]={},k=1; scanf ("%d",&n); for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } } */ /* #include <stdio.h> int main () { int i,j,n,k=1,arr[101][101]={}; scanf ("%d",&n); for (i=1;i<=n;i++) { for (j=n;j>=1;j--) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,n,j,k=1,arr[101][101]={}; scanf ("%d",&n); for (j=1;j<=n;j++) { for (i=1;i<=n;i++) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,n,j,k=1,arr[101][101]; scanf ("%d",&n); for (j=1;j<=n;j++) { for (i=n;i>=1;i--) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,n,m,j,k=1,arr[101][101]; scanf ("%d %d",&n,&m); for (i=n;i>=1;i--) { for (j=m;j>=1;j--) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=m;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } } */ /* #include <stdio.h> int main () { int i,j,k=1,arr[101][101]={},n,m; scanf ("%d %d",&n,&m); for (i=n;i>=1;i--) { for (j=1;j<=m;j++) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=m;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,n,m,arr[101][101]={},k=1; scanf ("%d %d",&n,&m); for (j=m;j>=1;j--) { for (i=n;i>=1;i--) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=m;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } } */ /* #include <stdio.h> int main () { int i,j,n,m,k=1,arr[101][101]={}; scanf ("%d %d",&n,&m); for (j=m;j>=1;j--) { for (i=1;i<=n;i++) { arr[i][j]=k++; } } for (i=1;i<=n;i++) { for (j=1;j<=m;j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,k=1,n,arr[101][101]= {}; scanf ("%d",&n); for (i=1; i<=n; i++) { if (i%2==1) { for (j=1; j<=n; j++) { arr[i][j]=k++; } } else { for (j=n; j>=1; j--) { arr[i][j]=k++; } } } for (i=1; i<=n; i++) { for (j=1; j<=n; j++) { printf ("%d ",arr[i][j]); } printf ("\n"); } return 0; } */
0
0
4
kimgeon7635
2021년 2월 02일
In 소스 코드 제출
/* #include <stdio.h> int main () { int i,a,r,n,d=1; scanf ("%d %d %d",&a,&r,&n); for (i=1;i<n;i++) { d=d*r; } printf ("%lld",(long long int)a*d); return 0; } */ /* #include <stdio.h> int main () { int i,j,h,k; char d; scanf ("%d %d %c",&h,&k,&d); for (i=1;i<=h;i++) { if (d=='L') { for (j=1;j<i;j++) { printf (" "); } for (j=1;j<=k;j++) { printf ("*"); } } else { for (j=1;j<=h-i;j++) { printf (" "); } for (j=1;j<=k;j++) { printf ("*"); } } printf ("\n"); } return 0; } printf ("%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,j,n,m; scanf ("%d %d",&n,&m); for (i=1;i<=m;i++) { for (j=1;j<=n;j++) { if (j==1&&i==1||i==m&&j==1||i==1&&j==n||i==m&&j==n) { printf ("+"); } else if (i==1||i==m) { printf ("-"); } else if (j==1||j==n) { printf ("|"); } else { printf (" "); } } printf ("\n"); } return 0; } #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for (i=1; i<=n; i++) { for (j=i; j<n; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } for (j=2; j<2*i; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } printf ("\n"); } for (i=n; i>=1; i--) { for (j=i; j<n; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } for (j=2; j<2*i; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } printf ("\n"); } return 0; } */ //배열 array /* int main() { int arr[1000],i,n; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d", &arr[i]); } }*/ /* int main () { int arr[1000],i,n; scanf ("%d",&n); for (i=0;i<n;i++) { scanf ("%d",&arr[i]); } for (i=n-1;i>=0;i--) { printf ("%d ",arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int arr[100],i,n; scanf ("%d",&n); for (i=0;i<n;i++) { scanf ("%d",&arr[i]); } for (i=0;i<n;i++) { printf ("%d\n",arr[i]); } for (i=0;i<n;i++) { printf ("%d\n",arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int arr[50],i,n,s=0,c=0; scanf ("%d",&n); for (i=1;i<=n;i++) { s=s+i; } for (i=0;i<n-1;i++) { scanf ("%d",&arr[i]); c=c+arr[i]; } printf ("%d",s-c); return 0; } */ /* #include <stdio.h> int main () { int i,j,arr[1000],n; scanf ("%d",&n); for (i=0; i<n; i++) { scanf ("%d",&arr[i]); } for (i=0; i<n; i++) { printf ("%d: ",i+1); for (j=0; j<n; j++) { if(i!=j) { if (arr[i]>arr[j]) { printf("> "); } else if(arr[i]==arr[j]) { printf ("= "); } else { printf ("< "); } } } printf("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,arr[10],k; for (i=0;i<10;i++) { scanf ("%d",&arr[i]); } scanf ("%d",&k); printf ("%d",arr[k-1]); return 0; } */ /* #include <stdio.h> int main () { int n,i,j,arr[1000]; scanf ("%d",&n); { for (i=0;i<n;i++) { scanf ("%d",&arr[i]); } for (i=0;i<n;i++) { for (j=i;j<n;j++) { printf ("%d ",arr[j]); } for (j=0;j<i;j++) { printf ("%d ",arr[j]); } printf ("\n"); } } return 0; } */ #include <stdio.h> int main () { int i,arr[1000000],n; scanf ("%d",&n); for (i=0;i<=n;i++) { i } } #include <stdio.h> int main () { int i,n,sum=0; scanf ("%d",&n); for (i=1;i<=n;i++) { sum=sum+(i*(i+1))/2; } printf ("%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,j,n,m; scanf ("%d %d",&n,&m); for (i=1;i<=m;i++) { for (j=1;j<=n;j++) { if (j==1&&i==1||i==m&&j==1||i==1&&j==n||i==m&&j==n) { printf ("+"); } else if (i==1||i==m) { printf ("-"); } else if (j==1||j==n) { printf ("|"); } else { printf (" "); } } printf ("\n"); } return 0; } #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for (i=1; i<=n; i++) { for (j=i; j<n; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } for (j=2; j<2*i; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } printf ("\n"); } for (i=n; i>=1; i--) { for (j=i; j<n; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } for (j=2; j<2*i; j++) { printf (" "); } for (j=1; j<=1; j++) { printf ("*"); } printf ("\n"); } return 0; } */ //배열 array /* int main() { int arr[1000],i,n; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d", &arr[i]); } }*/ /* int main () { int arr[1000],i,n; scanf ("%d",&n); for (i=0;i<n;i++) { scanf ("%d",&arr[i]); } for (i=n-1;i>=0;i--) { printf ("%d ",arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int arr[100],i,n; scanf ("%d",&n); for (i=0;i<n;i++) { scanf ("%d",&arr[i]); } for (i=0;i<n;i++) { printf ("%d\n",arr[i]); } for (i=0;i<n;i++) { printf ("%d\n",arr[i]); } return 0; } */ /* #include <stdio.h> int main () { int arr[50],i,n,s=0,c=0; scanf ("%d",&n); for (i=1;i<=n;i++) { s=s+i; } for (i=0;i<n-1;i++) { scanf ("%d",&arr[i]); c=c+arr[i]; } printf ("%d",s-c); return 0; } */ /* #include <stdio.h> int main () { int i,j,arr[1000],n; scanf ("%d",&n); for (i=0; i<n; i++) { scanf ("%d",&arr[i]); } for (i=0; i<n; i++) { printf ("%d: ",i+1); for (j=0; j<n; j++) { if(i!=j) { if (arr[i]>arr[j]) { printf("> "); } else if(arr[i]==arr[j]) { printf ("= "); } else { printf ("< "); } } } printf("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,arr[10],k; for (i=0;i<10;i++) { scanf ("%d",&arr[i]); } scanf ("%d",&k); printf ("%d",arr[k-1]); return 0; } */ /* #include <stdio.h> int main () { int n,i,j,arr[1000]; scanf ("%d",&n); { for (i=0;i<n;i++) { scanf ("%d",&arr[i]); } for (i=0;i<n;i++) { for (j=i;j<n;j++) { printf ("%d ",arr[j]); } for (j=0;j<i;j++) { printf ("%d ",arr[j]); } printf ("\n"); } } return 0; } */ #include <stdio.h> int main () { int i,arr[1000000],n; scanf ("%d",&n); for (i=0;i<=n;i++) { i } }
0
0
3
kimgeon7635
2021년 1월 28일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (a<=500) { printf ("%d",(int)((double)7/10*a)); } else if (a<=1500) { printf ("%d",(int)(350+(a-500)*(double)2/5)); } else if (a<=4500) { printf ("%d",(int)(750+(a-1500)*(double)3/20)); } else if (a<=10000) { printf ("%d",(int)(1200+(double)(a-4500)/20)); } else { printf ("%d",(int)(1475+(double)(a-10000)/50)); } return 0; } */ /* #include <stdio.h> int main () { int i=0,n; scanf ("%d",&n); while (n!=0) { n=n/10; i++; } printf ("%d",i); return 0; } */ //#include <stdio.h> //int main () //{ // int i,j,n,k; // scanf ("%d %d",&n,&k); // for (i=1;i<=n;i++) // { // for (j=1;j<=n;j++) // { // if (i==1||j==1||i==n||j==n||(i+j-1)%k==0) // { // printf ("*"); // } // else // { // printf (" "); // } // // } // printf ("\n"); // } // return 0; //} /* #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for (i=1;i<=n;i++) { for (j=1;j<=i;j++) // { printf ("*"); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for (i=n;i>=1;i--) { for (j=1;j<=i;j++) { printf ("*"); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,k,n; scanf ("%d",&n); for (i=n;i>=1;i--) { for (j=1;j<=n-i;j++) { printf (" "); } for (j=1;j<=i;j++) { printf ("*"); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for (i=1; i<=2*n-1; i++) { if(i<=n) { for (j=1; j<=i; j++) { printf ("*"); } } else { } printf ("\n"); } /* for (i=1;i<=n;i++) { for (j=1;j<=i;j++) { printf ("*"); } printf ("\n"); } for (i=2*n-1;i>=n+1;i--) { for (j=1;j<=i-n;j++) { printf ("*"); } printf ("\n"); } */ /* #include <stdio.h> int main () { int i,j,n,t; scanf ("%d",&n); t=(n+1)/2; for (i=1;i<=t;i++) { for (j=1;j<=t-i;j++) { printf (" "); } for (j=1;j<=2*i-1;j++) { printf ("*"); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for (i=n;i>=1;i--) { for (j=1;j<=i-1;j++) { printf (" "); } for (j=1;j<=n;j++) { printf ("*"); } printf ("\n"); } return 0; } */
0
0
1
kimgeon7635
2021년 1월 26일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } */ /* #include <stdio.h> int main () { double i,a,b; scanf ("%lf %lf",&a,&b); for (i=a;i<=b;i+=0.01) { printf ("%.2lf ",i); } return 0; } */ //i++ i=i+1 //i=i+0.01 i+=0.01 /* #include <stdio.h> int main () { int k,h; scanf ("%d %d",&k,&h); if(h%2==0) { if (k%2==0) { printf("%d",k*5+h*5); } else { printf ("%d",h*5+(k+1)/2); } } else { if (k%2==0) { printf ("%d",k*5+(h+1)/2); } else { printf ("%d",(k+1)/2+(h+1)/2); } } return 0; } { printf ("%d",k*5+0.5*(h+1)); } else if (k%2!=0&&h%2!=0) { printf ("%d",0.5*k0.5*h); } return 0; } */ /* #include <stdio.h> int main () { int i,n,k,s=1; scanf ("%d %d",&n,&k); for (i=1;i<=k;i++) { s=s*n; } printf ("%d",s); return 0; } */ /* #include <stdio.h> int main () { int i,n,s=1; scanf ("%d",&n); for (i=1;i<=n;i++) { s=s*i; } printf ("%d",s); return 0; } */ /* #include <stdio.h> int main () { int i,a,b,c,n; scanf ("%d %d %d %d",&a,&b,&c,&n); for (i=1;i<=n-1;i++) { a=a*b+c; } printf ("%d",a); return 0; } */ /* #include <stdio.h> int main () { int i,n,a,k=0; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&a); if (k<a) { k=a; } } printf ("%d",k); return 0; } */ /* 반복문 for while do-while for(시작식;조건식;증감식) { } /////////////////// 시작식; while(조건식) { 증감식; } ////////////////// 시작식; do{ 증감식 }while(조건식); */ //1077 1078 1076 -while //1074 1075 - do while /* #include <stdio.h> int main () { int i,n; scanf ("%d",&n); i=0; while (i<=n) { printf ("%d\n",i); i++; } return 0; } */ /* #include <stdio.h> int main () { int i,n,sum=0; scanf ("%d",&n); i=1; while (i<=n) { if (i%2==0) { sum=sum+i; } i++; } printf ("%d",sum); return 0; } */ /* #include <stdio.h> int main () { char i,a; scanf ("%c",&a); i='a'; while (i<=a) { printf ("%c ",i); i++; } return 0; } */ /* #include <stdio.h> int main () { int i,n; scanf ("%d",&n); i=n; do { printf ("%d\n",i); i--; } while (i>=1); return 0; } */ /* #include <stdio.h> int main () { int i,n; scanf ("%d",&n); i=n; do { i--; printf ("%d\n",i); } while (i>=1); return 0; } */ //중첩 반복문 /* #include <stdio.h> int main () { int i,j,n; scanf("%d",&n); for(i=0;i<n;i++) { for(j=0;j<5;j++) { printf("*"); } for(j=0;j<6;j++) { printf("^"); } printf("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,n,j; scanf ("%d",&n); for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { printf ("*"); } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,n,j; scanf ("%d",&n); for (i=1; i<=n; i++) { for (j=1; j<=n; j++) { if (i==1||i==n||j==1||j==n) { printf ("*"); } else { printf(" "); } } printf("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,n,j; scanf ("%d",&n); for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { if (j==1||j==n||i==1||i==n||j==i||j==n-i+1) { printf ("*"); } else { printf (" "); } } printf ("\n"); } return 0; } */ /* #include <stdio.h> int main () { int i,j,n; scanf ("%d",&n); for(i=1;i<=n;i++) { for (j=1;j<=n;j++) { if (i==1||i==n||j==1||j==n||j==i||j==n-i+1||j==(n+1)/2||i==(n+1)/2) { printf ("*"); } else { printf (" "); } } printf ("\n"); } return 0; } */
0
0
6
kimgeon7635
2021년 1월 21일
In 소스 코드 제출
/* #include <stdio.h> int main () { double a,b,c,d; scanf ("%lf %lf",&a,&b); if (a<150) { c=a-100; } else if (a<160) { c=(a-150)/2+50; } else { c=(a-100)*0.9; } d=(b-c)*100/c; if (d<=10) { printf ("정상"); } else if (d<=20) { printf ("과체중"); } else { printf ("비만"); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c,d; scanf ("%d %d %d",&a,&b,&c); if (a%5==0) { d=(90-a)/5+b; } else { d=(90-a)/5+b+1; } if (d>c) { printf ("win"); } else if (d==c) { printf ("same"); } else { printf ("lose"); } } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (a==0) { printf("aaaaa"); } else if(a==1) { printf("bbbbb"); } else { printf("cccc"); } switch(a) { case 0 : printf("aaaaa"); break; case 1 : printf("bbbbb"); break; case 2 : default : printf("cccc"); break; } } */ /* #include <stdio.h> int main () { int a,b,c,d; scanf ("%d %d %d %d",&a,&b,&c,&d); switch (a+b+c+d) { case 0 : printf ("모"); break; case 1 : printf ("도"); break; case 2 : printf ("개"); break; case 3 : printf ("걸"); break; case 4 : printf ("윷"); break; } return 0; } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); switch (a/10) { case 10 : printf ("A"); break; case 9 : printf ("A"); break; case 8 : printf ("B"); break; case 7 : printf ("C"); break; case 6 : printf ("D"); break; default : printf ("F"); break; } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d.%d",&a,&b); printf ("%d\n%d",a,b); } */ /* #include <stdio.h> int main () { int a,b,c,d,e; scanf ("%1d%1d%1d%1d",&a,&b,&c,&d,&e); printf ("[%d]\n[%d]\n[%d]\n[%d]\n[%d]\n",a*10000,b*1000,c*100,d*10,e); return 0; } */ //반복문 for while do-while /* #include <stdio.h> int main () { int i; //iteration 회차 //시작식;조건식;증감식 // for(i=1;i<=5;i++) for(i=10;i>=1;i++) { printf("*"); } //printf("%d",i); } */ /* #include <stdio.h> int main () { int i; for (i=1;i<=100;i++) { printf ("%d ",i); } return 0; } */ /* #include <stdio.h> int main () { char i,a,b; scanf("%c %c",&a,&b); for (i=a;i<=b;i++) { printf ("%c ",i); } return 0; } */ /* #include <stdio.h> int main () { int i,a,b; scanf ("%d %d",&a,&b); for (i=a;i<=b;i++) { if (i%2!=0) { printf ("%d ",i); } } return 0; } */ /* #include <stdio.h> int main () { int i,n,sum=0; scanf ("%d",&n); for (i=1;i<=n;i++) { sum=sum+i; } printf("%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,a,b,sum=0; scanf ("%d %d",&a,&b); for (i=a;i<=b;i++) { if (i%3==0) { sum=sum+i; } } printf ("%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,n,t,sum=0; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&t); sum=sum+t; } printf ("%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,n,t,sum=0; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d",&t); if (t%5==0) { sum=sum+t; } } printf ("%d",sum); return 0; } */ /* #include <stdio.h> int main () { int i,n,; scanf ("%d",&n); for (i=1;i<=n;i++) { if (n%i==0) { printf("%d ",i); } } return 0; } */ /* #include <stdio.h> int main () { int i,n,cnt=0; scanf ("%d",&n); for (i=1; i<=n; i++) { if(n%i==0) { cnt++; } } if (cnt==2) { printf ("prime"); } else { printf ("not prime"); } return 0; } */
0
0
7
kimgeon7635
2021년 1월 19일
In 소스 코드 제출
/* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } */ /* #include <stdio.h> int main () { int h,b,c,s; scanf ("%d%d%d%d",&h,&b,&c,&s); printf ("%.1f MB",((long long int)h*b*c*s)/(float)(1024*1024*8)); return 0; } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (a%7==0) { printf ("multiple"); } else { printf ("not multiple"); } return 0; } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (a%2==0) { printf ("even"); } else { printf ("odd"); } return 0; } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (50<=a&&a<=70) { printf ("win"); } else if (a%6==0) { printf ("win"); } else { printf ("lose"); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); if (a>170&&b>170&&c>170) { printf ("PASS"); } else { printf ("CRASH"); } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); b = b+(90-a)/5; if (a%5!=0) { b++; } printf ("%d",b); return 0; } */ /* #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"); } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); if (b<30) { if (a==0) { printf ("%d %d",a+23,30+b); } else { printf ("%d %d",a-1,30+b); } } else { printf ("%d %d",a,b-30); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); if (c>a&&c>b) { if(c<a+b) { printf ("yes"); } else { printf ("no"); } } else if(b>a&&b>c) { if(b<a+c) { printf ("yes"); } else { printf ("no"); } } else { if(a<b+c) { printf ("yes"); } else { printf ("no"); } } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); a=a/10000; if(b==1||b==2) { printf("%d",113-a); } else { printf("%d",13-a); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); printf ("%d%d%02d",a,b,c); return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d",&c); a=c/10; b=c%10; c=(b*10+a)*2; c=c%100; printf ("%d\n",c); if (c<=50) { printf ("GOOD"); } else { printf ("OH MY GOD"); } return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); if(c<a+b) { if (a==b&&b==c) { printf ("정삼각형"); } else if (a==b||b==c||c==a) { printf ("이등변삼각형"); } else if (a*a+b*b==c*c) { printf ("직각삼각형"); } else { printf("삼각형"); } } else { printf ("삼각형아님"); } return 0; } */ /* #include <stdio.h> int main() { int a,b,c,d; float e,f; scanf ("%d %d %d %d",&a,&b,&c,&d); e=(float)a/b; f=(float)c/d; if (e>f) { printf (">"); } else if (e==f) { printf ("="); } else { printf ("<"); } return 0; } */
0
0
1
kimgeon7635
2021년 1월 14일
In 소스 코드 제출
* #include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } */ /* #include <stdio.h> int main () { long long int a; scanf("%lld",&a); printf("%lld",a++); printf("%d",a); return 0; } */ /* #include <stdio.h> int main () { int a; scanf("%d",&a); printf("%d%%",a); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); printf("%lld",(long long int)a+b); return 0; } */ /* #include <stdio.h> int main () { float a,b; scanf ("%f %f", &a,&b); printf ("%0.2f",a*b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); printf("%lld\n",(long long int)a+b); printf("%lld\n",(long long int)a-b); printf ("%lld\n",(long long int)a*b); printf ("%d\n",a/b); printf ("%d\n",a%b); printf ("%0.2f",(float)a/b); return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); printf ("%lld\n",(long long int)a+b+c); printf ("%0.1f",(float)(a+b+c)/3); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf ("%0.1f",(float)(a*b)/2); return 0; } */ /* #include <stdio.h> int main () { int a; scanf("%d",&a); printf("%0.3f",(float)9/5*a+32); return 0; } */ /* 산술 연산자 + - * / % 비교 연산자 > < >= <= == != =을 항상 오른쪽에 써야 한다. => =< =! 안된다!!! a>b 참 1 거짓 0 a=b 대입 연산자 b를 a에 대입하시오 a==b 같으면 참 1 다르면 거짓 0을 리턴 1049-1052 */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf("%d",a>b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d", &a,&b); printf ("%d",a==b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf ("%d",a<=b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf ("%d",a!=b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",a,b); printf ("%d",a%b); return 0; } */ /* 논리연산자 논리 참1 거짓0 not !a !1 0 !0 1 !80 0 !9999 0 and a&&b 그리고 둘 다 참일때만 결과가 참 a b a&&b 0 0 0 0 1 0 1 0 0 1 1 1 or a b a||b 0 0 0 0 1 1 1 0 1 1 1 1 1053-1055 */ /* #include <stdio.h> int main () { int a; scanf("%d",&a); printf("%d",!a); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); printf("%d",a&&b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); printf("%d",a||b); return 0; } 1059-1062 */ /* #include <stdio.h> int main () { int a,b; scanf("%d",&a); printf("%d",~a); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); printf("%d",a&b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf("%d",a|b); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf ("%d",a^b); return 0; } */ //조건식? 1 : 2 /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf("%d",a>b?a:b); return 0; } */ /* #include <stdio.h> int main () { int a,b,c; scanf ("%d %d %d",&a,&b,&c); printf ("%d",(a<b?a:b)<c?(a<b?a:b):c); return 0; } 1135-1144 */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (a<10) { printf ("small"); } return 0; } */ /* #include <stdio.h> int main () { int a; scanf ("%d",&a); if (a<10) { printf("small"); } else { printf("big"); } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); if (a>b) { printf(">"); } else if (b>a) { printf("<"); } else { printf("="); } return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf("%d %d",&a,&b); if (a>b) { printf("%d",a-b); } else { printf("%d",b-a); } return 0; } */
0
0
3
kimgeon7635
2021년 1월 12일
In 소스 코드 제출
/* #include <stdio.h> int main() { printf("Hello"); return 0; } */ /* #include <stdio.h> int main () { printf ("Hello World"); return 0; } */ /* #include <stdio.h> int main () { printf ("Hello\nWorld"); return 0; } */ /* #include <stdio.h> int main () { printf ("\'Hello\'"); return 0; } */ /* #include <stdio.h> int main () { printf ("\"Hello World\""); return 0; } */ /* #include <stdio.h> int main () { printf ("\"!@#$%%^&*()\""); return 0; } */ /* #include <stdio.h> int main () { printf ("\"C:\\Download\\hello.cpp\""); return 0; } */ /* #include <stdio.h> int main () { int n; scanf("%d",&n); printf("%d",n); return 0; } */ /* #include <stdio.h> int main () { char x; scanf("%c",&x); printf("%c",x); return 0; } */ /* #include <stdio.h> int main () { float x; scanf ("%f",&x); printf ("%f",x); return 0; } */ /* #include <stdio.h> int main () { int a,b; scanf ("%d %d",&a,&b); printf ("%d %d",a,b); return 0; } */ /* #include <stdio.h> int main () { char x, y; scanf ("%c %c",&x,&y); printf ("%c %c",y,x); return 0; } */ /* #include <stdio.h> int main () { float a; scanf ("%f",&a); printf ("%.2f",a); return 0; } */ /* #include <stdio.h> int main () { int a; scanf("%d",&a); printf("%d %d %d",a,a,a); return 0; } */ /* #include <stdio.h> int main () { double d; scanf ("%lf",&d); printf ("%.11lf",d); return 0; } */ /* #include <stdio.h> int main() { long long int n; scanf ("%lld",&n); printf ("%lld",n); return 0; } */ /* #include <stdio.h> int main () { int a, b; scanf("%d %d", &a, &b); printf("%lld", (long long int)a+b); return 0; } */ /* #include <stdio.h> int main () { long long int a,b; scanf ("%lld %lld", &a,&b); printf ("%lld",a+b); return 0; } */
0
0
4
kimgeon7635
더보기
bottom of page