fork download
  1. #include<iostream>
  2. #include<string.h>
  3. #define size 1000
  4. using namespace std;
  5. struct Name
  6. {
  7. char name[30];
  8. };
  9. void main()
  10. {
  11. struct Name a[size];
  12. int n;
  13. cout << "Hay nhap so luong nguoi:";
  14. cin >> n;
  15. cin.ignore(80, '\n');
  16. cout << "Hay nhap danh sach !" << endl;
  17. for (int i = 0;i<n;i ++)
  18. {
  19. printf("%d. ", i);
  20. cin.get(a[i].name, 30);
  21. cin.ignore(80, '\n');
  22. }
  23. for (int i = 0;i<n;i = i + 1)
  24. strupr(a[i].name);
  25. cout << "Danh sach sau khi xu li: " << endl;
  26. for (int i = 0;i<n;i = i + 1)
  27. {
  28. cout <<i<<"."<< a[i].name<<endl;
  29. }
  30. system("pause");
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:11: error: ‘::main’ must return ‘int’
 void main()
           ^
prog.cpp: In function ‘int main()’:
prog.cpp:24:19: error: ‘strupr’ was not declared in this scope
   strupr(a[i].name);
                   ^
stdout
Standard output is empty