forked from srikanthmalipatel/Spoj-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHELLOKIT-3453296-src.c
More file actions
39 lines (39 loc) · 822 Bytes
/
HELLOKIT-3453296-src.c
File metadata and controls
39 lines (39 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<stdio.h>
#include<string.h>
#define MAX 10000
int main()
{
char a[MAX];
int n,i,j,br,len,k,p;
scanf("%s",a);
while(a[0]!='.')
{
scanf("%d",&n);
br = strlen(a);
len = br*n;
for(j=0 ; j<br ; j++)
{
p = j+len;
k=0;
for(i=j; i<p ; i++)
{
if(i<br) printf("%c",a[i]);
else if((k<br)&&(i>=br))
{
printf("%c",a[k]);
k++;
}
else if((k>=br)&&(i>=br))
{
k=0;
printf("%c",a[k]);
k++;
}
}
printf("\n");
}
printf("\n");
scanf("%s",a);
}
return 0;
}