int main string SATO 4R 8H string s1 char arr 32 int int for 32 arr ar

 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
int main()
{
string s= "SATO@4R@8H";
string s1="";
char arr[32];
int c=0;
int i=0;
for( i;i<32,s[i]!='\0';i++)
{
arr[i]=s[i];
}
arr[i+1]='\0';
for(int i=0;arr[i]!='\0';i++)
{
if(arr[i]=='@')
{
for(int j =0; j<arr[i+1]-48;j++)
{
s1+=arr[i+2];
}
i+=2;
}
else{s1+=arr[i];}
}
for(int i=0;s1[i]!='\0';i++)
{
cout<<s1[i];
}
system("PAUSE");
return 0;
}