Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

One/윤현수: Difference between revisions

From ZeroWiki
imported>Unknown
No edit summary
 
(Table transclusion repair v1)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{|
1 2 5 6 8 10
1 2 5 6 8 10
|}}
  #include <stdio.h>
  #include <stdio.h>
   
   
Line 62: Line 60:
      
      
   
   
  int a [10];
  int a [10];
   
   
  int c;
  int c;
Line 70: Line 68:
  for (c=0; c<=9; c++)
  for (c=0; c<=9; c++)
  {       
  {       
     a[c] = 10-c;
     a[c] = 10-c;
  printf("%d ",a[c]);
  printf("%d ",a[c]);
                  
                  
  }
  }
Line 83: Line 81:
----
----
[[One]]
[[One]]

Latest revision as of 12:46, 27 March 2026

1 2 5 6 8 10

#include <stdio.h>

int main(){
int i;
for(i=1;i<=10;i++)
{
    if (i==3 || i==4 || i==7 || i==9)
    continue;
    printf("%d ",i);
}
    system("pause");  
}

1 - 10 합

#include <stdio.h>

int main(){
int i;
int plus=0;
for(i=0;i<=10; i++)

{
    plus+=i;     
}
printf("%d",plus);


    system("pause");  
}

숫자 입력받음. 입력값이 1이면 64출력, 2이면 10출력, 3이면 23출력, 그 이외의 값이면 "error" 출력

#include <stdio.h>

int main(){


int i;

printf("숫자를 입력하세요"); scanf("%d" ,&i);
if (i==1)
printf ("64");
if (i==2)
printf ("10");
if (i==3)
printf ("23");
if (i>3)
printf ("error");




    system("pause");  
}

배열 작성

#include <stdio.h>

int main(){
   

int a [10];

int c;



for (c=0; c<=9; c++)
{      
   a[c] = 10-c;
printf("%d ",a[c]);
               
}



system("pause");  


}

One