TEMA
wrong error 5%
lbrandao11 preguntado 4 years ago
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main(){
int n;
string str;
cin >> n;
cin.ignore();
int sensor = 0;
for(int i = 0; i < n; i++){
getline(cin, str);
for(int j = 0; j < str.length(); j++){
if(str[j] != ' ' && sensor == 0){
cout << str[j];
sensor = 1;
}
if(str[j] == ' ')
sensor = 0;
}
cout << endl;
}
}
Este tema aún no ha sido contestado. ¡Sé el primero!