SHARE
TWEET

加空格

a guest Jun 15th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.     char s[100];
  5.     char comc[2] = {'\0'};
  6.     fgets(s, sizeof(s), stdin);
  7.     for(int i = 0; i < 100 && s[i] != '\r' && s[i] != '\n'; ++i){
  8.         printf("%s%c", comc, s[i]);
  9.         comc[0] = ' ';
  10.     }
  11.     return 0;
  12. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top