백준 온라인 저지 1475번 - 방 번호
By 1%! 10%. | 2018년 2월 11일 |
#include <stdio.h>#include <string.h> int main(){ char str[8]={ 0, }; // 방 번호. gets(str); int Nnum[11] = { 0, }; //방 번호에 사용한 숫자의 개수 0~9까지. int Sum = 0; // 6과 9의 사용 개수 합계 int Max = 0; // 최대로 사용한 숫자 개수. int i; for(i = 0; i < strlen(str); i++){ Nnum[str[i]-'0']++; // !문자열에서 char로 입력받았단 것 주의! } for(i = 0; i < 10; i++){ if(i == 6 |