while (! std::cin.eof ()) {
std::cin >> q >> v >> rho;
}
while(scanf("%lf %lf %lf", &q, &v, &rho) != EOF) {
// ...
}
for line in sys.stdin:
q, v, rho = map(float, line.split())
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
q = sc.nextDouble();
v = sc.nextDouble();
rho = sc.nextDouble();
}