fork(4) download
  1. #include <stdio.h>
  2.  
  3. const int MX=3;
  4.  
  5. int mat[] = { 100,90900, 3 };
  6. char *name[] = { "Mr.X", "Mr.& Ms Yamamoto", "Georges Zed" };
  7. char *classe[]= { "A3","B3","E10" };
  8.  
  9. int main() {
  10.  
  11. printf("+=================+============================+=================+\n");
  12. printf("| Matricule | Nom & Prenom | Classe |\n");
  13. printf("+=================+============================+=================+\n");
  14. for (int i=0; i<MX; i++) {
  15. printf("| %11d | %-25.25s | %-*.*s |\n", mat[i],name[i],14,14,classe[i]);
  16. }
  17. printf("+=================+============================+=================+\n");
  18. return 0;
  19. }
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
+=================+============================+=================+
|   Matricule     |         Nom & Prenom       |       Classe    |
+=================+============================+=================+
|         100     | Mr.X                       | A3              |
|       90900     | Mr.& Ms Yamamoto           | B3              |
|           3     | Georges Zed                | E10             |
+=================+============================+=================+