xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

主要運(yùn)用字符串?dāng)?shù)組知識(shí)的c++基礎(chǔ)練習(xí),很簡(jiǎn)單很能鍛煉初學(xué)者的一道題

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
using?namespace?std;
void?convert(double?moneystring?&?result)
{
string?num[10]={“零““壹““貳““叁““肆““伍““陸““柒““捌““玖“};
string?ten[]?=?{“““拾““佰““仟““萬““億““兆“};
int?intMoney?=?money;//先求取整數(shù)部分
double?floatMoney?=?(int)((money-intMoney)*100)/100.0;//先求取小數(shù)部分

int?MaoMoney?=?(int)(floatMoney*10);
int?FenMoney?=?(int)(floatMoney*100)%10;

//生成小數(shù)部分大寫
string?strFloatMoney;
if(MaoMoney!=0?&&?FenMoney==0)
{
strFloatMoney?=?num[MaoMoney]?+?“角“;
}
else?if(MaoMoney==0?&&?FenMoney==0)
{
strFloatMoney?=?““;
}
else
strFloatMoney?=?num[MaoMoney]?+?“角“?+?num[FenMoney]?+?“分“;

//生成整數(shù)部分大寫
int?ZeroStartZeroEnd;//用于記錄連續(xù)0的起止位置
int?j=0;
string?strIntMoney=““;
while(intMoney!=0)
{
ZeroStart?=?-1;
ZeroEnd?=?-1;
int?temp4Money?=?intMoney%10000;?//從右往左,每四位生成一段大寫
intMoney?=?intMoney/10000;
string?tmpresult;
int?pretemp1Money?=?-1;
bool?isZeroLow=false;
for(int?i=0;i<4;i++)//每四位作為一個(gè)輪次生成大寫數(shù)字
{
int?temp1Money?=?temp4Money%10;
if(temp1Money==0)//如果遇到0,設(shè)置起止位置

評(píng)論

共有 條評(píng)論