top of page

소스 코드 제출

공개·회원 72명

250716

/*

#include <stdio.h>

#include <string.h>

int main()

{

char str[101]={};

int i,sum=0;

gets(str);

for(i=0;str[i]!=NULL;i++)

{

if(str[i]=='l'&&str[i+1]=='o'&&str[i+2]=='v'&&str[i+3]=='e')

sum++;

}

printf("%d", sum);

return 0;

}

*/

/**

아스키코드 : 모든 문자에 대한 고유 코드넘버가 있다.

'\0' 0 NULL


' ' 32


'0' 48

'1' 49

...


'9'

'10' (x)


'A' 65

'B' 66

..



'Z'



'a' 97

'b' 98

...

'z'



127


*/


/**

#include <stdio.h>

#include <string.h>

int main()

{

printf("%c\n",'a'+1);

printf("%c\n",'a'-32);

printf("%d\n",'a');


if(str[i]=='t') //(OK)

if(str[i]==116) //(OK)


if('A'<=str[i]) //(OK)

return 0;

}

*/

/*

#include <stdio.h>

#include <string.h>

int main()

{

char str[1001]={};

int i;

gets(str);

for(i=0;str[i]!=NULL;i++)

{

if('A'<=str[i]&&str[i]<='Z')

{

printf("%c", str[i]+32);

}

else if('a'<=str[i]&&str[i]<='z')

{

printf("%c",str[i]-32);

}

else

printf("%c",str[i]);

}

}

*/

/*

#include <stdio.h>

#include <string.h>

int main()

{

char str[21]={};

int i;

gets(str);

for(i=0;str[i]!=NULL;i++)

{

printf("%c", str[i]+2);

}

printf("\n");

for(i=0;str[i]!=NULL;i++)

{

printf("%c", (str[i]*7)%80+48);

}

return 0;

}

*/

/*

#include <stdio.h>

#include <string.h>

int main()

{

char str[201]={};

int i;

gets(str);

for(i=0;str[i]!=NULL;i++)

{

if(str[i]==' ')

printf(" ");

else if(str[i]=='a')

printf("%c", 'x');

else if(str[i]=='b')

printf("%c", 'y');

else if(str[i]=='c')

printf("%c", 'z');

else

printf("%c", str[i]-3);

}

return 0;

}


int나 long long int로 저장할 수 없는 더 큰 숫자를 저장할때!

char str[100]="5000000000000000000000000000000000000000000000000000000";


str[0] '5' , 53

str[1] '0' , 48



str[0] * 10 + str[1] (x)

'5' * 10 + '0' (x)

53 * 10 + 48 (x)



(str[0]-'0')


*/

/*

#include <stdio.h>

#include <string.h>

int main()

{

char str[5000]={};

int i,sum=0;

gets(str);

for(i=0;str[i]!=NULL;i++)

{

sum=sum+str[i];

}

if(sum%3==0)

{

printf("1");

}

else

printf("0");

}

*/

#include <stdio.h>

#include <string.h>

int main()

{

char str[101]={},s[101]={};

int i,k=0,h=0;

scanf("%s", &str);

scanf("%s", &s);

for(i=0;str[i]!=NULL;i++)

{

if(str[i]>s[i])

k=k+1;

else if(s[i]>str[i])

h=h+1;


if(k==1)

break;

if(h==1)

break;

}

if(k>h)

printf("%s %s", s, str);

else

printf("%s %s", str, s);

}

6회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page