if( ) ;
if( sales > 2000 ) bonus = 200; if( score >= 60 ) printf(".\n"); if( height >= 130 && age >= 10 ) printf(".\n"); if ( temperature < 0 ) printf(".\n"); // printf(" %.\n \n", temperature); //
if( score >= 60 ) { printf(".\n"); printf(".\n"); }
// if #include <stdio.h> int main(void) { int number; printf(" :"); scanf("%d", &number); if( number > 0 ) printf(".\n"); if( number == 0 ) printf(" 0.\n"); if( number < 0 ) printf(".\n");.\ } return 0;
// if #include <stdio.h> int main(void) { int number; printf(" :"); scanf("%d", &number); if( number % 2 == 1 ) printf(".\n"); if( number % 2 == 0 ) printf(".\n"); return 0; }
// if #include <stdio.h> int main(void) { int number; printf(" :"); scanf("%d", &number); if( number < 0 ) number = -number; printf(" %d.\n", number); } return 0; :-5 5.
날씨가좋은가? 거짓 참 테니스를친다. 공부를한다. if( ) 1; else 2;
if ( score >= 60 ) printf(".\n"); else printf(".\n"); if ( score >= 60 ) { printf(".\n"); printf(".\n \n"); } else { printf(".\n"); printf(".\n"); }
// if-else. #include <stdio.h> int main(void) { int number; printf(" :"); scanf("%d", &number); if( number % 2 == 0 ) printf(".\n"); else printf(".\n"); } return 0;
// 0 if-else #include <stdio.h> int main(void) { int n1, n2, n3; printf(" : "); scanf("%d", &n1); printf(" : "); scanf("%d", &n2); if( n2 == 0 ) // 0 { printf("0.\n"); } else { n3 = n1 / n2; // printf(" %d.\n", n3); } return 0; }
// #include <stdio.h> int main(void) { int year; printf(" : "); scanf("%d", &year); if((year % 4 == 0 && year % 100!= 0) year % 400 == 0) printf("%d.\n \n", year); else printf("%d.\n", year); } return 0;
if( 1 ) if( 2 ) ;
if( score > 80 ) if( score > 90 ) printf(" A.\n \n"); if( score > 80 ) if( score > 90 ) printf(" A.\n"); else printf(" B.\n");
당신의학점은 입니다 당신의학점은 입니다 if( score > 80 ) { if( score > 90 ) printf(" A.\n"); } else printf(" A B.\n");
if( score > 80 ) { if( score > 90 ) printf(" A.\n"); else printf(" B.\n"); } else { if( score > 70 ) printf(" C.\n"); else printf(" D F.\n"); }
#include <stdio.h> int main(void) id) { int n1, n2, n3, min; printf(" 3 :"); scanf("%d %d %d", &n1, &n2, &n3); } if( n1 < n2 ) if( n1 < n3 ) min = n1; else min = n3; else if( n2 < n3 ) min = n2; else min = n3; printf(" %d \n", min); return 0;
if( 1 ) 1; else if( 2 ) 2; else if( 3 ) 3; else 4;
if (score >= 90) printf(": A\n"); else if (score >= 80) printf(": B\n"); else if (score >= 70) printf(": C\n"); else if (score >= 60) printf(": D\n"); else printf(" : F\n");
#include <stdio.h> int main(void) { int score; printf(" : "); scanf("%d", &score); if (score >= 90) printf(": A\n"); else if (score >= 80) printf(": B\n"); else if (score >= 70) printf(": C\n"); else if (score >= 60) printf(": D\n"); else pintf(" : F\n"); printf(" : F\n"); return 0; }
// #include <stdio.h> int main(void) { char ch; printf(" : "); scanf("%c", &ch); if( ch >= 'A' && ch <= 'Z' ) printf("%c.\n", ch); else if( ch >= 'a'' && ch <= 'z'' ) printf("%c.\n", ch); else if( ch >= '0' && ch <= '9' ) printf("%c.\n", ch); else printf("%c.\n", ch); return 0; }
// #include <stdio.h> int main(void) id) { char op; int x,,y; printf(" : "); scanf("%d %c %d", &x, &op, &y); } if( op == '+' ) printf("%d %c %d = %d \n", x, op, y, x + y); else if( op == '-' ) printf("%d %c %d = %d \n", x, op, y, x - y); else if( op == '*' ) printf("%d %c %d = %d \n", x, op, y, x * y); else if( op == '/' ) printf("%d %c %d = %d \n", x, op, y, x / y); else if( op == '%' ) printf("%d %c %d = %d \n", x, op, y, x % y); else printf(". \n"); return 0;
int main(void) id) switch(number) { { int number; case 0: scanf("%d", &number); printf("\n"); ") break; case 1: if( number == 0 ) printf("\n"); printf("\n"); break; else if( number == 1 ) case 2: printf("\n"); ") else if( number == 2 ) printf(" \n"); else printf("\n"); } } printf( \n"); break; default: printf("\n"); break;