TOPTECH11 Telegram 56
برنامج تحويل الاعداد الى نصوص باستخدام c++
#include<iostream>
#include<string>
using namespace std;

int main()
{
string digits[20]={"Zero ","One ","Two ","Three ","Four ","Five ",
"Six ","Seven ","Eight ","Nine ","Ten ","Eleven ","Twelve ",
"Thirteen ","Fourteen ","Fifteen ","Sixteen ","Seventeen ",
"Eighteen ","Nineteen "};

string tens[8]={"Twenty ","Thirty ","Forty ","Fifty ","Sixty ","Seventy ","Eighty ","Ninety "};

int n;

cout << "Insert a Number : ";
cin >> n;

int num[9];

for(int i=8 ; i>=0 ; i--)
{
num[i]=n%10;
n=n/10;
}

bool a=(num[0]+num[1]+num[2] > 0);
bool b=(num[3]+num[4]+num[5] > 0);
bool c=(num[6]+num[7]+num[8] > 0);

cout<<"\n";

for(int k=0 ; k<=6 ; k+=3)
{
if(num[k] != 0)
cout << digits[num[k]] << "Hundred ";

if(num[k+1] > 1)
cout << tens[num[k+1] - 2];

if(num[k+1] == 1)
cout << digits[10 * num[k+1] + num[k+2]];

if(num[k+1]!=1 && num[k+2]!= 0)
cout << digits[num[k+2]];

if(k==0 && a)
{
cout << "Million ";
if(b || c) cout << ",\n";
}

if(k==3 && b)
{
cout << "Thousand ";
if(c) cout << ",\n";
}
}

cout << "\n\n";
return 0;
}



tgoop.com/toptech11/56
Create:
Last Update:

برنامج تحويل الاعداد الى نصوص باستخدام c++
#include<iostream>
#include<string>
using namespace std;

int main()
{
string digits[20]={"Zero ","One ","Two ","Three ","Four ","Five ",
"Six ","Seven ","Eight ","Nine ","Ten ","Eleven ","Twelve ",
"Thirteen ","Fourteen ","Fifteen ","Sixteen ","Seventeen ",
"Eighteen ","Nineteen "};

string tens[8]={"Twenty ","Thirty ","Forty ","Fifty ","Sixty ","Seventy ","Eighty ","Ninety "};

int n;

cout << "Insert a Number : ";
cin >> n;

int num[9];

for(int i=8 ; i>=0 ; i--)
{
num[i]=n%10;
n=n/10;
}

bool a=(num[0]+num[1]+num[2] > 0);
bool b=(num[3]+num[4]+num[5] > 0);
bool c=(num[6]+num[7]+num[8] > 0);

cout<<"\n";

for(int k=0 ; k<=6 ; k+=3)
{
if(num[k] != 0)
cout << digits[num[k]] << "Hundred ";

if(num[k+1] > 1)
cout << tens[num[k+1] - 2];

if(num[k+1] == 1)
cout << digits[10 * num[k+1] + num[k+2]];

if(num[k+1]!=1 && num[k+2]!= 0)
cout << digits[num[k+2]];

if(k==0 && a)
{
cout << "Million ";
if(b || c) cout << ",\n";
}

if(k==3 && b)
{
cout << "Thousand ";
if(c) cout << ",\n";
}
}

cout << "\n\n";
return 0;
}

BY TOP-TECH


Share with your friend now:
tgoop.com/toptech11/56

View MORE
Open in Telegram


Telegram News

Date: |

Ng was convicted in April for conspiracy to incite a riot, public nuisance, arson, criminal damage, manufacturing of explosives, administering poison and wounding with intent to do grievous bodily harm between October 2019 and June 2020. Each account can create up to 10 public channels During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month. The best encrypted messaging apps Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months.
from us


Telegram TOP-TECH
FROM American