TÓPICO

wrong error 5%

lbrandao11 perguntou 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 tópico ainda não foi respondido. Seja o primeiro!

Lembre de não publicar soluções. Sua publicação pode ser revisada por nossos moderadores.