Advertisement
rdsedmundo

test

Mar 9th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. /* by kyl3 xd */
  2. using namespace std;
  3.  
  4. #include <stdio.h>
  5. #include <windows.h>
  6.  
  7. int main(int args, char *argss[])
  8. {
  9.   float gnote=0;
  10.  
  11.   for(int i = 1; i <= 5; i++)
  12.   {
  13.       float pNote;
  14.       printf("Digite a %da nota: \n", i);
  15.       scanf("%f", &pNote);
  16.  
  17.       if(pNote < 5.0 || pNote > 10.0)
  18.       {
  19.           i--;
  20.           continue;
  21.       }
  22.  
  23.       printf("Nota dada: %f\n\n", pNote);
  24.       (i == 5||i == 1) ? i : gnote += pNote;
  25.   }
  26.  
  27.   printf("Nota final: %f", gnote);
  28.  
  29.   return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement