Difference between r1.2 and the current
@@ -70,11 +70,13 @@
* maxnum = (*guess) - 1;
printf("Down.\n");
}
#include <stdio.h>
void main(){int n,i,j;scanf("%d",&n);for(i=0;i<n;i++){for(j=0;j<n;j++){(i==0||i==n-1)?printf("*"):((j==0||j==n-1)?printf("*"):printf(" "));}puts("");}}
#include <stdio.h>
printf("Down.\n");
}
}}}
{{{
//숏코딩#include <stdio.h>
void main(){int n,i,j;scanf("%d",&n);for(i=0;i<n;i++){for(j=0;j<n;j++){(i==0||i==n-1)?printf("*"):((j==0||j==n-1)?printf("*"):printf(" "));}puts("");}}
}}}
{{{
//체스판#include <stdio.h>
데블스캠프2009/월요일/연습문제/svn코드레이스/박준호 ¶
//업앤다운 #include <stdio.h> #include <stdlib.h> #include <time.h> void up(int *, int*); void down(int *, int *); int main(void) { int number; int guess; int maxnum = 50; int minnum = 1; srand((unsigned)time(NULL)); number = rand() % 50; printf("%d\n", number); while(1) { if( maxnum - minnum == 0) { printf("당신이 이기셨습니다. You Win\n"); exit(1); } printf("숫자를 입력하시오 범위는 %d 부터 %d 입니다. \n", minnum, maxnum); scanf("%d", &guess); if( (guess > maxnum) || (guess < minnum) ) { printf("먹고 ,다시 말하시오\n"); } else { if( number > guess) { up(&guess, &minnum); } else if(number < guess) { down(&guess, &maxnum); } else { printf("당신은 졌습니다. 게임이 끝낫습니다. \n"); exit(1); } } } return 0; } void up(int *guess, int* minnum) { * minnum = (*guess) + 1; printf("Up.\n"); } void down(int * guess, int * maxnum) { * maxnum = (*guess) - 1; printf("Down.\n"); }
//숏코딩 #include <stdio.h> void main(){int n,i,j;scanf("%d",&n);for(i=0;i<n;i++){for(j=0;j<n;j++){(i==0||i==n-1)?printf("*"):((j==0||j==n-1)?printf("*"):printf(" "));}puts("");}}
//체스판 #include <stdio.h> #include <stdlib.h> void main(){ int n,i,j,k; int *ptr; while(1){ scanf("%d",&n); if(n%2 == 0) { ptr=(int*)malloc(sizeof(int)*(n*n)); for(i = 0; i < n; i++) {for(j = 0; j < n; j++) { ((i+j)%2 == 0)?printf("0"):printf("1"); } puts(""); } break; } else{ printf("다시 입력하세요"); continue; } } }