summaryrefslogtreecommitdiff
path: root/sonstiges/Roman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sonstiges/Roman.cpp')
-rw-r--r--sonstiges/Roman.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/sonstiges/Roman.cpp b/sonstiges/Roman.cpp
index 195f833..c5ead54 100644
--- a/sonstiges/Roman.cpp
+++ b/sonstiges/Roman.cpp
@@ -24,17 +24,11 @@ string convertToRoman(int n) {
n -= num[i];
}
}
- int pos = roman.find("CCCC");
- if(pos != string::npos) roman.replace(pos,4,"CD");
- pos = roman.find("XXXX");
- if(pos != string::npos) roman.replace(pos,4,"XL");
- pos = roman.find("IIII");
- if(pos != string::npos) roman.replace(pos,4,"IV");
- pos = roman.find("DCD");
- if(pos != string::npos) roman.replace(pos,3,"CM");
- pos = roman.find("LXL");
- if(pos != string::npos) roman.replace(pos,3,"XC");
- pos = roman.find("VIV");
- if(pos != string::npos) roman.replace(pos,3,"IX");
+ int pos = roman.find("CCCC"); if(pos != string::npos) roman.replace(pos,4,"CD");
+ pos = roman.find("XXXX"); if(pos != string::npos) roman.replace(pos,4,"XL");
+ pos = roman.find("IIII"); if(pos != string::npos) roman.replace(pos,4,"IV");
+ pos = roman.find("DCD"); if(pos != string::npos) roman.replace(pos,3,"CM");
+ pos = roman.find("LXL"); if(pos != string::npos) roman.replace(pos,3,"XC");
+ pos = roman.find("VIV"); if(pos != string::npos) roman.replace(pos,3,"IX");
return roman;
}