Varianta 94 / Subiectul 2 / Problema 4 |
#include<iostream.h> #include<string.h> void main() { char s[20], x[20]="",y[20]=""; cin.get(s,20); int i=0; while(s[i]!=' ') { x[i]=s[i]; i++; } x[i]='\0'; int k=0; while(s[i]==' ') i++; while(i<strlen(s)) { y[k]=s[i]; k++; i++; } y[k]='\0'; cout<<y<<" "<<x; } |