From 0b84d23b92a2fbe9952fcc9529ff7090d430c19f Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Mon, 24 Oct 2016 17:32:49 +0800 Subject: [PATCH] Create 1874.cpp --- QUSTOJ/1874.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 QUSTOJ/1874.cpp diff --git a/QUSTOJ/1874.cpp b/QUSTOJ/1874.cpp new file mode 100644 index 0000000..84fae6f --- /dev/null +++ b/QUSTOJ/1874.cpp @@ -0,0 +1,46 @@ +#include +#include +using namespace std; + +int main() +{ + int x; + cin>>x; + while(x>=1000) + { + cout<<"M"; + x-=1000; + } + while(x>=500) + { + cout<<"D"; + x-=500; + } + while(x>=100) + { + cout<<"C"; + x-=100; + } + while(x>=50) + { + cout<<"L"; + x-=50; + } + while(x>=10) + { + cout<<"X"; + x-=10; + } + while(x>=5) + { + cout<<"V"; + x-=5; + } + while(x>=1) + { + cout<<"I"; + x-=1; + } + cout<