#include<iostream> #include<sstream> using namespace std; int main() { int i=0,j; double a[100]; string s; getline(cin,s); stringstream ss; ss<<s; while(ss>>a[i]) i++; for(j=0;j<i;j++) cout<<a[j]<<endl; }
虽然不理解,死记硬背吧
#include<iostream> #include<sstream> using namespace std; int main() { int i=0,j; double a[100]; string s; getline(cin,s); stringstream ss; ss<<s; while(ss>>a[i]) i++; for(j=0;j<i;j++) cout<<a[j]<<endl; }
虽然不理解,死记硬背吧
转载于:https://www.cnblogs.com/mayouyou/p/8991803.html