top of page

소스 코드 제출

공개·회원 50명

20250610

//#include<stdio.h>

//int main()

//{

// int i, x=1, arr[1005]={},cnt=0, n,temp,c=0, a=0;

// scanf("%d", &n);

// for(i=1;i<=n;i++)

// {

// scanf("%d", &arr[i]);

// }

// while(c<n)

// {

// if (arr[x]==0)

// {

// if (x==0)

// {

// x = n;

// continue;

// if (c>=n)

// {

// return 0;

// }

// }

// else if(x==n+1)

// {

// x=1;

// continue;

// if (c>=n)

// {

// return 0;

// }

// }

// else

// {

// if (a>0)

// {

// x++;

// }

// else

// {

// x--;

// }

// continue;

// }

// }

// if (cnt==a)

// {

// c++;

// printf("%d ", x);

// cnt = 0;

// temp = arr[x];

// arr[x]=0;

// if (temp>0)

// {

// x++;

// cnt++;

// }

// else

// {

// x--;

// cnt--;

// }

// a = temp;

// continue;

// }

// else

// {

// if (a>0)

// {

// cnt++;

// x++;

// }

// else

// {

// cnt--;

// x--;

// }

// continue;

// }

// }

// return 0;

//}

//#include<stdio.h>

//int main()

//{

// int m, i,t, k, temp, j, n, arr[100005][3]={}, bo=1,x, top=0, wi=0;

// scanf("%d", &n);

// i=1;

// j=1;

// while(i<=n)

// {

// scanf("%d", &k);

// arr[i][0]=k;

// arr[j][2]=k;

// i++;

// j++;

// }

// i=1;

// j=1;

// x = n;

// t = 1;

// while(j<=x)

// {

// scanf("%d", &arr[i][1]);

// if (arr[j][2]==1)

// {

// i--;

// n--;

// }

// i++;

// j++;

// }

// scanf("%d", &m);

// i=n;

// j=1;

// while(i>=1)

// {

// arr[j][0]=arr[i][1];

// i--;

// j++;

// }

// top = n;

// i=1;

// while(i<=m)

// {

// scanf("%d", &k);

// wi++;

// top++;

// arr[top][0]=k;

// printf("%d ", arr[wi][0]);

// i++;

// }

// return 0;

//}

#include<stdio.h>

#include<string.h>

int main()

{

char str[1000005]={}, bom[40]={};

int i, len1, len2, j,boo=0, cnt=0, be, temp, l;

scanf("%s %s", &str, &bom);

len1 = strlen(str);

len2 = strlen(bom);

while(1)

{

cnt =0;

be = 1;

i=0;

while(i<len1)

{

if (be==1 && str[i]!='.')

{

be = 0;

}

if (str[i]==bom[0])

{

boo=1;

temp = len2;

j=1;

l=1;

while(l<temp)

{

if (str[i+l]!='.')

{

if (str[i+l]!=bom[j])

{

boo = 0;

break;

}

}

else

{

temp++;

j--;

}

j++;

l++;

}

if (boo)

{

j=0;

while(j<temp)

{

str[i+j] = '.';

j++;

}

cnt++;

}

}

i++;

}

if (cnt==0)

{

if (be)

{

printf("FRULA");

}

else

{

for(i=0;i<len1;i++)

{

if (str[i]!='.')

{

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

}

}

}

return 0;

}

}

return 0;

}

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