본문 바로가기
프로그래밍/C_정보올림피아드 Language_Coder

CODE 104~105 출력 - 형성평가 4~5

by Royal! 2020. 8. 28.
728x90
반응형

CODE 104

 

#include<stdio.h>

int main(void){

int kor,mat, eng, sum=0, avg=0;


kor = 90;
mat = 80;
eng = 100;
sum = (kor+mat+eng);
avg=(kor+mat+eng)/3; 


printf("kor %d\nmat %d\neng %d\nsum %d\navg %d",kor,mat,eng,sum,avg);

return 0;
}

 

 

 

 

 

 

 

 

 

CODE 105

#include<stdio.h>

int main(void) {
char Seoul[] = "Seoul";
char Seoul_[] = "10, 312, 545";
char Seoul1_[] = "+91, 375";
char Pusan[] = "Pusan";
char Pusan_[] = "3, 567, 910";
char Pusan1_[] = "+5, 868";
char Incheon[] = "Incheon";
char Incheon_[] = "2, 758, 296";
char Incheon1_[] = "+64, 888";
char Daegu[] = "Daegu";
char Daegu_[] = "2, 511, 676";
char Daegu1_[] = "+17, 230";
char Gwangju[] = "Gwangju";
char Gwangju_[] = "1, 454, 636";
char Gwangju1_[] = "+29, 744";

printf("%15s%15s%15s\n", Seoul, Seoul_, Seoul1_);
printf("%15s%15s%15s\n", Pusan, Pusan_, Pusan1_);
printf("%15s%15s%15s\n", Incheon, Incheon_, Incheon1_);
printf("%15s%15s%15s\n", Gwangju, Gwangju_, Gwangju1_);

return 0;
}

 

 

 

 

 

 

 

 

728x90
반응형

최근댓글

최근글

Royal! © 2024