fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n;
  8. string str;
  9. cin>>n;
  10.  
  11. cin.ignore();
  12.  
  13. for(int i=0;i<n;i++){
  14. getline(cin,str);
  15. if(str[str.size()-1]!='.'){
  16. str+='.';
  17. }
  18.  
  19. cout<<str<<'\n';
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 5320KB
stdin
3
You kicked my dog
No I did not.
It was the kid that did
stdout
You kicked my dog.
No I did not.
It was the kid that did.