Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace SecondProjet
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. Console.WriteLine("c koi ton prénom ?");
  13. String prenom = Console.ReadLine();
  14. String verdict = "admis(e)";
  15. int moy = -1;
  16. while (moy < 0 || moy > 20)
  17. {
  18. Console.WriteLine("c koi ta moyenne (0-20) ?");
  19. try
  20. {
  21. moy = int.Parse(Console.ReadLine());
  22. }
  23. catch (FormatException e)
  24. {
  25. Console.WriteLine("wtf c pas un nombre");
  26. break;
  27. }
  28. catch (OverflowException e)
  29. {
  30. Console.WriteLine("wtf c koi ça");
  31. break;
  32. }
  33. }
  34. if (moy >= 0 && moy <= 20)
  35. {
  36. if (moy < 9)
  37. verdict = "recalé(e)";
  38. else if (moy < 10) verdict = "rattrapé(e)";
  39. }
  40. Console.WriteLine(prenom + " ben t'es " + verdict);
  41. Console.ReadLine(); //Pause
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement