fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n;
  8. string str1,str2;
  9.  
  10. cin>>n;
  11.  
  12. for(int i=1;i<=n;i++){
  13. cin>>str1>>str2;
  14.  
  15. cout<<"Case "<<i<<": "<<str2<<", "<<str1<<"\n";
  16. }
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5284KB
stdin
5
Tyler
Lopez
Alexandra
Johnson
Martin
Young
Sabrina
Chao
Arjun
Gupta
stdout
Case 1: Lopez, Tyler
Case 2: Johnson, Alexandra
Case 3: Young, Martin
Case 4: Chao, Sabrina
Case 5: Gupta, Arjun