Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace p
- {
- class Program
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("Combien de notes ?");
- int nombreNote = int.Parse(Console.ReadLine());
- int compteurNote = 1;
- int noteTotal = 0;
- while (compteurNote != nombreNote + 1)
- {
- Console.WriteLine("Note " + compteurNote);
- int note = int.Parse(Console.ReadLine());
- if (note < 0 || note > 20)
- {
- Console.WriteLine("Cette valeur est fausse");
- }
- else
- {
- noteTotal = noteTotal + note;
- compteurNote++;
- }
- }
- Console.WriteLine("La moyenne est de " + noteTotal / nombreNote);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment