CODE 125 반복제어문1 - 형성평가 1~5

2020. 9. 3. 23:51·프로그래밍/C_정보올림피아드 Language_Coder
728x90
반응형

 

#include<stdio.h>
int main(void){
   int a=0 , b=1;
   scanf("%d",&a);
   while(b<=a){
   printf("%d",b++);
  }

}

정답은 틀렸다고 나옵니다...

 

CODE 127

#include<stdio.h>

int main(void){
int score, sum, b;
score=sum=b=0;

do{
scanf("%d",&score);
if(score>=0 && score<=100)
{
sum+=score;
b++;
}
else
{
break;
}
}while(score<101);
printf("sum : %d\navg : %.1f",sum,(float)sum/b);

return 0; 
}

CODE 128

#include<stdio.h>

int main(void){
int a,b;
a=1; b=0;

do{
scanf("%d",&a);
if((a%3)!=0 && (a%5)!=0)  // AND연산자 말고 OR연산자로 해도 상관 없을것 같다.
{
b++; 
}
}while(a!=0);
printf("%d",b);
}

 

CODE 129

#include "stdio.h"

int main(void)
{
int base,height,width;
char c='y';
base = height = width = 0;
do{

printf("Base = ");
scanf("%d",&base);
printf("Height = ");
scanf("%d",&height);
printf("Triangle width = %.1f\n",(float)base*height/2);
printf("Continue? ");
scanf(" %c",&c);
}while(c=='y'|| c=='Y');

return 0;
}

 

728x90
반응형

'프로그래밍 > C_정보올림피아드 Language_Coder' 카테고리의 다른 글

CODE 130~138 반복제어문2 - 형성평가1~A  (0) 2020.09.05
CODE 541~548 : 반복제어문2 - 자가진단1~8  (0) 2020.09.04
CODE 633 반복제어문 1 자가진단6  (0) 2020.09.02
CODE 538 반복제어문 1 자가진단 3~4  (0) 2020.09.01
CODE 120~124 선택제어문 - 형성평가 1~5  (0) 2020.08.31
'프로그래밍/C_정보올림피아드 Language_Coder' 카테고리의 다른 글
  • CODE 130~138 반복제어문2 - 형성평가1~A
  • CODE 541~548 : 반복제어문2 - 자가진단1~8
  • CODE 633 반복제어문 1 자가진단6
  • CODE 538 반복제어문 1 자가진단 3~4
Royal!
Royal!
Bachelor of Arts. Bachelor of Science in Engineering. Master of Science in Engineering (In Progress). Job Title: Infrastructure & Security & Cloud Engineer. Etc: Mentor at Fourth Industrial Revolution Center.
  • Royal!
    Security
    Royal!
  • 전체
    오늘
    어제
    • 분류 전체보기
      • 운영체제
      • 네트워크
      • 클라우드
      • 서버
        • Container
      • 보안
      • 프로그래밍
        • Python_혼자 끄적끄적
        • Python_AI(영상처리)
        • 빅데이터
        • C_정보올림피아드 Language_Coder
        • C_QnA
      • 자격증
        • 정보보안기사
        • 정보처리기사
        • ADsP
        • CPPG
        • 보안법률
        • NCA~NCP
        • AWS Certified Solutions Arc..
      • 기타
        • 면접일지
        • 기타 활동
        • 인턴활동
        • 논문 요약
        • Hackerschool FTZ
        • 리버싱 걸음마
      • 기타 교육
        • KISA 정보보호제품실습군
        • 빅데이터_분석실무
        • 시큐어코딩진단전문교육(호남정보보호센터)
        • SW테스트 전문가 과정(ISTQB CTFL자격)
        • 정보보호 컨설팅 전문가 양성과정
        • K-Shield Jr_악성코드분석
        • K-Shield Jr_침해사고분석
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    F5 WAF
    openstack lbaas
    ICT이노베이션스퀘어
    우수교육생
    블록체인누리단
    LBaaS설치
    SSRF란
    ai
    nce덤프
    F5 AWAF
    fragment-free
    openstack F5연동
    swtich frame
    SSRF 완화방법
    nce dump
    WAF SSRF
    SSRF 막는 방법
    2025블록체인누리단
    openstack설치
    스위치 프레임 동작 방식
    네이버클라우드 ftp 설정
    LBaaS
    switch forwarding mode
    F5 LBaaS
    F5 SSRF
    지그립토
    l2 스위치 프레임 전달 방식
    SSRF 방어방법
    openstack LBaaS설치
    블록체인체험
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Royal!
CODE 125 반복제어문1 - 형성평가 1~5
상단으로

티스토리툴바