Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char input[100];
- int kounter, angka;
- cout<<"Masukan kalimat = ";
- cin.getline(input, 100);
- angka=1;
- cout<<"Kata "<<angka<<" : ";
- for(kounter=0; kounter<strlen(input); kounter++){
- if(input[kounter]==' '){
- angka++;
- cout<<endl;
- cout<<"Kata "<<angka<<" :";
- }
- cout<<input[kounter];
- }
- cout<<endl;
- cout<<"Jumlah Kata = "<<angka;
- }
Add Comment
Please, Sign In to add comment