luyencode / comments

Server lưu trữ bình luận trên Luyện Code
https://luyencode.net
6 stars 3 forks source link

cha hieu sao sai ? #789

Open mr36-cyberx2 opened 2 years ago

mr36-cyberx2 commented 2 years ago

include <bits/stdc++.h>

using namespace std; main () { int t=0; cin>>t; string s; bool kt; cin.ignore(); while (t>0) { kt=false; int kq=0; getline(cin,s); for (unsigned int i=0;i<s.size();i++) { if (s[i]==' ') kt=true; if ( (s[i]!=' ') && (kt==true) ) {kt=false; kq++;} } //kq--; cout<<kq<<endl; --t; } return 0; }