Programalama > C++


Ort. 0
Puan ver:
#include <stdlib.h>
#include <iostream>
#include<cstring>
using std::cout;
using std::cin;
using std::endl;

int main()
{
	unsigned long int i,k,c;
//	int i,k,c;

	char a[21],b[21];
	cout<<"number  :";
	cin>>a;
	
	c=strlen(a);


	for(i=0;i<21-c;i++)
		b[i]='0';


	for(i=21-c;i<21;i++)
		b[i]=a[i-21+c];


	for(k=0;k<7;k++)
	{
		for(i=0;i<3;i++)
		{
			if(i==0)
			{
				if (b[k*3+i]=='1')
					cout<<"yuz";
				if (b[k*3+i]=='2')
					cout<<"ikiyuz";

				if (b[k*3+i]=='3')
					cout<<"ucyuz";

				if (b[k*3+i]=='4')
					  cout<<"dortyuz";

				if (b[k*3+i]=='5')
					  cout<<"besyuz";

				if (b[k*3+i]=='6')
					  cout<<"altiyuz";

			    if (b[k*3+i]=='7')
				      cout<<"yediyuz";

			    if (b[k*3+i]=='8')
					  cout<<"sekizyuz";

			    if (b[k*3+i]=='9')
				     cout<<"dokuzyuz";}
       
			    else if(i==1)
				{

				    if (b[k*3+i]=='1')
						cout<<"on";
					if (b[k*3+i]=='2')
						cout<<"yirmi";
					if (b[k*3+i]=='3')
						cout<<"otuz";
					if (b[k*3+i]=='4')
						cout<<"kirk";
					if (b[k*3+i]=='5')
						cout<<"elli";
					if (b[k*3+i]=='6')
						cout<<"altmis";
					if (b[k*3+i]=='7')
						cout<<"yetmis";
					if (b[k*3+i]=='8')
						cout<<"seksen";
					if (b[k*3+i]=='9')
						cout<<"doksan";
				}
				else 
				{
					if (b[k*3+i]=='1')
					{
						if(k*3+i==17&&b[k*3-1+i]=='0'&&b[k*3-2+i]=='0')
							cout<<"bin";
						else
							cout<<"bir";
					}
					if (b[k*3+i]=='2')
						cout<<"iki";
					if (b[k*3+i]=='3')
						cout<<"uc";
					if (b[k*3+i]=='4')
						cout<<"dort";
					if (b[k*3+i]=='5')
						cout<<"bes";
					if (b[k*3+i]=='6')
						cout<<"alti";
					if (b[k*3+i]=='7')
						cout<<"yedi";
					if (b[k*3+i]=='8')
						cout<<"sekiz";
					if (b[k*3+i]=='9')
						cout<<"dokuz";}
		}
		if(b[k*3]!='0'||b[k*3+1]!='0'||b[k*3+2]!='0')
		{
			 if(k==0)
				 cout<<"kentrilyon";
			 else if(k==1)
				 cout<<"katrilyon";
			 else if(k==2)
				 cout<<"trilyon";
			 else if(k==3)
				 cout<<"milyar";
			 else if(k==4)
				 cout<<"milyon";
			 else if(k==5&&b[15]!='0'&&b[16]!='0')
			 {
				  cout<<"bin";
			 }
		}
    
    }
    
    
cout<<endl;
    system ("pause");
    
	return 0;
        
}


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.