标签:des style blog io ar color sp for 数据
whli##ilr#e(s#*s) outcha@putchar(*s=#++);
while(*s) putchar(*s++);
#include<stdio.h> #include<string.h> int main() { char s[1000]; char q[10000]; while(gets(s)!=NULL) { memset(q, 0, sizeof(q)); int j=0; for(int i=0; i<strlen(s); i++) { if(s[i]!=‘#‘ && s[i]!=‘@‘) q[j++] = s[i]; else if(s[i]==‘#‘&& j!=0)//应该加上j!=0,放置越界(a##sd). j--; else if(s[i]==‘@‘) { for(int k=0; k<j; k++) q[k] = 0; j=0; } } for(int i=0; i<j; i++) { if(i==j-1) printf("%c\n", q[i]); else printf("%c", q[i]); } } return 0; }
标签:des style blog io ar color sp for 数据
原文地址:http://www.cnblogs.com/6bing/p/4113839.html