Facebook
From Diminutive Macaw, 4 Years ago, written in C#.
This paste is a reply to Re: exercício média_v2 from Paltry Shama - view diff
Embed
Download Paste or View Raw
Hits: 204
  1. using System;
  2.                                        
  3. public class Program
  4. {
  5.         public static void Main()
  6.         {
  7.                 int n1,n2,n3;
  8.                 Console.WriteLine("Primeira nota: ");
  9.                 n1=int.Parse(Console.ReadLine());
  10.                 Console.WriteLine("Segunda nota: ");
  11.                 n2=int.Parse(Console.ReadLine());
  12.                                 Console.WriteLine("Terceira nota: ");
  13.                                 n3=int.Parse(Console.ReadLine());
  14.                
  15.                 int media;
  16.                 media=(n1+n2+n3)/3;
  17.                 if(media<10){
  18.                         Console.WriteLine("Reprovado");
  19.                 }else{
  20.             Console.WriteLine("Aprovado");  
  21.             if(media>15){
  22.                 Console.WriteLine("Estás no bom caminho!");
  23.             }else{
  24.                 Console.WriteLine("Força, tu consegues!");
  25.             }
  26.                        
  27.                 }
  28.                
  29.                
  30.                 Console.WriteLine("Nota: "+media);
  31.         }
  32. }