>> Edit article
이름
제목
패스워드
: 학교 과제물인데여...넘 어려워서여....코드를 짜오라는데...에혀~ 잘모르겠거든여... : 제발좀 알려주세여...^^;; : : 문제1> 주어진 문자열 "It is very important for you to study C programming."를 배열에 저장한 후 공백,콤마, 마침표의 수를 세는 프로그램을 작성하시오. : : : : 문제2> 다음 표의 내용을 배열 a에 저장한 후 결과를 가로, 세로의 총계와 함께 출력하는 프로그램을 작성하시오. : : 13 15 16 : 21 23 4 : 8 17 43 : 13 55 36 : : : : 제발 오늘 밤까지좀 알려주세여~~ 부탁드립니다.~~~ㅜ 1번인데...이런걸 원하시는건가용?? #include <stdio.h> int main() { int i=0,comma=0,blank=0,period=0; char text[]="It is very important for you to study C programming."; while(text[i]!=' ') { switch(text[i++]){ case ' ' : blank+=1; break; case '.' : period+=1; break; case ',' : comma+=1; break; default : break; } } printf("Comma = %d , Blank = %d , period = %d ", comma,blank,period); return 0; }
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved