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)
 
Line 2: Line 2:
   
   
----
----
{{|
1 2 5 6 8 10
1 2 5 6 8 10
|}}


  #include <stdio.h>
  #include <stdio.h>
Line 24: Line 22:
  }
  }


{{|1에서 10까지 더하기 |}}
1에서 10까지 더하기
  #include <stdio.h>
  #include <stdio.h>
   
   
Line 39: Line 37:
     system("PAUSE");
     system("PAUSE");
  }
  }
{{|
숫자입력
숫자입력
|}}
  #include <stdio.h>
  #include <stdio.h>
   
   
Line 59: Line 55:
   system("pause");           
   system("pause");           
  }
  }
{{|
배열
배열|}}
  #include <stdio.h>
  #include <stdio.h>
   
   
  void main()
  void main()
  {
  {
  int a[10];
  int a[10];
  int b = 10;
  int b = 10;
  int c = 0;
  int c = 0;
   for ( ; b>=1 ;b--)
   for ( ; b>=1 ;b--)
   {
   {
   a[c] = b ;
   a[c] = b ;
   printf("a[%d]번째 %d\n",c,a[c]);
   printf("a[%d]번째 %d\n",c,a[c]);
   c = c + 1 ;
   c = c + 1 ;
    
    
Line 82: Line 77:
----
----
[[One]]
[[One]]

Latest revision as of 12:46, 27 March 2026

1 - 10 출력


1 2 5 6 8 10

#include <stdio.h>

void main()
{
    
  int a =0 ;
while(a < 10 )
{
  a =a+1 ;
 if (a==3 || a==4 || a == 7 || a == 9 )
    continue ;
 printf("%d " , a);
  
}

  system("PAUSE");	
}

1에서 10까지 더하기

#include <stdio.h>

void main()
{
    int a;
    int b=0;
    for (a = 1 ; a<=10 ; a ++ )
    { 
         b = b + a;
     
    }
    printf("%d", b ) ;
    system("PAUSE");	
}

숫자입력

#include <stdio.h>

void main()
{
 int a ;
 printf("숫자를 입력하세요 \n 입 력 란 : ") ;
 scanf("%d", &a);
 if ( a== 1 )
 printf("64");
   else if (a == 2 )
     printf("10");
       else if (a == 3 )
         printf("23");
          else
           printf("에러잔아 이자식아 \n");
 system("pause");           
}

배열

#include <stdio.h>

void main()
{
int a[10];
int b = 10;
int c = 0;
 for ( ; b>=1 ;b--)
 {
  a[c] = b ;
  printf("a[%d]번째 %d\n",c,a[c]);
  c = c + 1 ;
  
 }  
 
 system("pause");           
}


One