-
Notifications
You must be signed in to change notification settings - Fork 0
/
echo.c
42 lines (41 loc) · 1.08 KB
/
echo.c
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
40
41
42
#include "header.h"
void echo(char* buff){
long long int len = strlen(buff);
int check =0;
for(long long int i=0;i<len;i++){
if(check){
if(buff[i]!=' '){
int j=0;
if(buff[i]=='"' || buff[i]=='\''){
char c=buff[i];
i++;
char s[100005];
j=0;
while(buff[i]!=c && i<len){
s[j]=buff[i];
j++;
i++;
}
s[j]='\0';
printf("%s ",s);
}
else {
char s[100005];
j=0;
while(buff[i]!=' ' && i<len){
s[j]=buff[i];
j++;
i++;
}
s[j]='\0';
printf("%s ",s);
}
}
}
else if(buff[i]=='e'){
check=1;
i=i+3;
}
}
printf("\n");
}