#include<iostream> #include<string> using namespace std; int main() { char str[100]; char c; gets(str); cin >> c; for (int i = 0; i < strlen(str); i++) { if (str[i] != c) { cout << str[i]; } } cin >> str; return 0; } /* Main.cc: In function 'int main()': Main.cc:8:2: warning: 'char* gets(char*)' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(str); ^ Main.cc:8:10: warning: 'char* gets(char*)' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(str); ^ Main.cc:10:32: error: 'strlen' was not declared in this scope for (int i = 0; i < strlen(str); i++) { ^ */ |
Double click to view unformatted code.