Advertisement
cd62131

remove alphabet + digit

Dec 6th, 2018
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <ctype.h>
  2. #include <stdio.h>
  3. int main(void) {
  4.   char s[100];
  5.   printf("文字列(100 文字未満): ");
  6.   fgets(s, 100, stdin);
  7.   printf("記号: ");
  8.   for (char *p = s; *p; ++p) {
  9.     if (!isalnum(*p)) {
  10.       putchar(*p);
  11.     }
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement