Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
回馈社会,教你如何输入#include <iostream> #include <fstream> #include <string> using namespace std; const int N = 10; double data[N][N], p[N][N], curr[N], next[N]; int n; string str; void findN() { n = 0; double x = 0.0; int len = str.size(); for(int i = 0; i < len; i++) { if(str[i] == ' ') data[0][n++] = x, x = 0.0; else x = (x*10 + (str[i] - '0')); } data[0][n++] = x; } int main() { while(getline(cin, str)) { if(str.size() == 0) continue; findN(); for(int i = 1; i < n; i++) for(int j = 0; j < n; j++) cin>>data[i][j]; //your code here } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator