C++输入方式input

对坑爹的输入的两种输入方式

#include 
#include 
#include 
using namespace std;


int main() {
    string str;
    while (getline(cin, str)) {
        int s;
        stringstream stm(str);
        while (stm >> s) {
            
        }
    }
    return 0;
}
int main() {
    char str[500];
    while (gets(str)) {
        cout << str;
    }
    return 0;
}

你可能感兴趣的:(C++输入方式input)