SHARE
TWEET

Assignment Solution

zero_jim Jun 25th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///Function is written in C++
  2. void toFunc()
  3. {
  4.     char ch[10005];
  5.     int i;
  6.     for(i=0;i<10005;i++)
  7.     {
  8.         if(ch[i-1]=='"'||ch[i-1]==',')
  9.             i=i-1;
  10.         scanf("%c",&ch[i]);
  11.         if(ch[i]==']')
  12.             break;
  13.     }
  14.     int co=0;
  15.     for(int j=1;j<i;j++)
  16.     {
  17.         if(ch[j]==' ')
  18.         {
  19.             cout<<endl;
  20.             for(int m=1;m<co;m++)
  21.                 cout<<' ';
  22.             co=co-1;
  23.             continue;
  24.         }
  25.         printf("%c",ch[j]);
  26.         co++;
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top