Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include <iostream>

#include <math.h>
using namespace std;

int main(int argc, char *argv[]) {


int x= 0;
double nota;

cout << "dame la nota: ";


cin>> nota;
x = (nota>=3)?round(nota):floor(nota);

switch (x) {
case 0:
cout <<"F"<<endl;
break;

case 1:
cout <<"E"<<endl;
break;

case 2:
cout <<"D"<<endl;
break;

case 3:
cout <<"C"<<endl;
break;

case 4:
cout <<"B"<<endl;
break;

case 5:
cout <<"A"<<endl;
break;

default:
cout <<"error"<<endl;
}
system("pause");
system("cls");

return 0;
}

You might also like