fork download
  1. #include <stdio.h>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5. int main(void) {
  6. // your code goes here
  7. int studentSize, id, mark1,mark2,mark3;
  8. string name, programme, course1, course2, course3;
  9. char delim;
  10.  
  11. cin >> studentSize >> programme >> delim;
  12. cout << studentSize << ", " << programme << ", " << delim << endl;
  13. while(cin >> name >> id >> course1 >> mark1 >> course2 >> mark2 >> course3 >> mark3)
  14. {
  15. cout << name << ", " << id << ", " << mark1 << ", " << course1 << ", " << mark2 << ", " << course2 << ", " << mark3 << ", " << course3 << endl;
  16. cin >> ws >> delim;
  17. }
  18. }
Success #stdin #stdout 0s 3436KB
stdin
2
Mathematics
&
Ashley    
7961000
Doto
99
C++
99
Meh
99
&
Dwayne
7961222
Quantum
99
heh*
99
Computing
99
stdout
2, Mathematics, &
Ashley, 7961000, 99, Doto, 99, C++, 99, Meh
Dwayne, 7961222, 99, Quantum, 99, heh*, 99, Computing