ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

C++ programacion


Enviado por   •  2 de Abril de 2020  •  Tareas  •  394 Palabras (2 Páginas)  •  79 Visitas

Página 1 de 2

#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

using namespace std;

int main()

{

int x;

for(int i = 0; i<=3; i++){

cout<<"ingrese un numero"<<endl;

cin>>x;

if((x<1)||(x>999))

cout<<"Ingrese un numero entre 0-999"<<endl;

else

{

if(x>=900) {cout<<"CM" ;x=x-900; }

if(x>=500) {cout<<"D" ;x=x-500; }

if(x>=400) {cout<<"CD" ;x=x-400; }

if(x>=300) {cout<<"C" ;x=x-100; }

if(x>=200) {cout<<"C" ;x=x-100; }

if(x>=100) {cout<<"C" ;x=x-100; }

if(x>=90) {cout<<"XC" ;x=x-90; }

if(x>=50) {cout<<"L" ;x=x-50; }

if(x>=40) {cout<<"XL" ;x=x-40; }

if(x>=30) {cout<<"X" ;x=x-10; }

if(x>=20) {cout<<"X" ;x=x-10; }

if(x>=10) {cout<<"X" ;x=x-10; }

if(x>=9) {cout<<"IX" ;x=x-9; }

if(x>=5) {cout<<"V" ;x=x-5; }

if(x>=4) {cout<<"IV" ;x=x-4; }

if(x>=3) {cout<<"III";x=x-3; }

if(x>=2) {cout<<"II" ;x=x-2; }

if(x>=1) {cout<<"I" ;x=x-1; }

}

}

cout<<endl;

return 0;

}

...

Descargar como (para miembros actualizados)  txt (1 Kb)   pdf (28 Kb)   docx (7 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com