Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int am=1000000;
- int print()
- {
- long long int i,n;
- for(i=0;i<100000000;i++)
- {}cout<<"\t\t\t\t\t\tL";
- for(i=0;i<100000000;i++)
- {}cout<<"o";
- for(i=0;i<100000000;i++){}
- cout<<"a";
- for(i=0;i<100000000;i++){}
- cout<<"d";
- for(i=0;i<100000000;i++){}
- cout<<"i";
- for(i=0;i<100000000;i++){}
- cout<<"n";
- for(i=0;i<100000000;i++){}
- cout<<"g";
- for(i=0;i<100000000;i++){}
- cout<<".";
- for(i=0;i<100000000;i++){}
- cout<<".";
- for(i=0;i<100000000;i++){}
- cout<<".";
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- for(i=0;i<100000000;i++){}
- }
- void dp(int n)
- {
- if(n>am)
- {
- cout<<endl<<endl;
- print();
- cout<<"\n\n\t\t\t\t\t\t!!!!!! Insufficient balance. !!!!!!"<<endl;
- return ;
- }
- map<int,int> m;
- map<int,int> :: iterator it;
- int i,j,k;
- int a[]={1,2,5,10,20,50,100,500,1000};
- int t[10][n+1];
- char x[10][n+1];
- for(i=0;i<10;i++)
- {
- t[i][0]=0;
- }
- for(i=1;i<=n;i++)
- {
- t[0][i]=1000000;
- }
- for(i=1;i<=9;i++)
- {
- for(j=1;j<=n;j++)
- {
- if(a[i-1]>j)
- {
- t[i][j]=t[i-1][j];
- x[i][j]='u';
- }
- else
- {
- if(1+t[i][j-a[i-1]]<t[i-1][j])
- {
- t[i][j]=1+t[i][j-a[i-1]];
- x[i][j]='l';
- }
- else{
- t[i][j]=t[i-1][j];
- x[i][j]='u';
- }
- }
- }
- }
- cout<<endl<<endl<<" \t\t\t\t\t\tThe minimum number of note is: "<<t[9][n]<<endl;
- cout<<endl<<" \t\t\t\t\t\tUsed Notes are : "<<endl;
- i=9;
- j=n;
- while(i>0&&j>0)
- {
- if(x[i][j]=='l')
- {
- m[a[i-1]]++;
- j-=a[i-1];
- }
- else{
- i-=1;
- }
- }
- for(it=m.begin();it!=m.end();it++)
- {
- cout<<"\t\t\t\t\t\t"<<it->first<<" Taka Notes * "<<it->second<<endl;
- }
- am-=n;
- }
- int convert()
- {
- int x,y;
- double a,tk;
- printf("\n\n\t\t\t\t\t\tFor Dollar press 1.\n\t\t\t\t\t\tFor Euro press 2.\n\t\t\t\t\t\tFor riyal press 3.\n\t\t\t\t\t\tFor Pound press 4.\n\t\t\t\t\t\tFor Rupee press 5.\n");
- printf("\n\t\t\t\t\t\tPlease input your choice:");
- scanf("%d",& x);
- if(x==1)
- {
- printf("\n\t\t\t\t\t\tAmount of Dollar :");
- scanf("%lf",&a);
- tk=a*84.92;
- printf("\n\n\t\t\t\t\t\t%0.2lf Dollar = %.0lf TK\n",a,tk);
- }
- else if(x==2)
- {
- printf("\n\t\t\t\t\t\tAmount of Euro :");
- scanf("%lf",&a);
- tk=a*94.05;
- printf("\n\n\t\t\t\t\t\t%0.2lf Euro = %.0lf TK\n",a,tk);
- }
- else if(x==3)
- {
- printf("\n\t\t\t\t\t\tAmount of Riyal :");
- scanf("%lf",&a);
- tk=a*22.64;
- printf("\n\n\t\t\t\t\t\t%0.2lf Riyal = %.0lf TK\n",a,tk);
- }
- else if(x==4)
- {
- printf("\n\t\t\t\t\t\tAmount of Pound :");
- scanf("%lf",&a);
- tk=a*112.01;
- printf("\n\n\t\t\t\t\t\t%0.2lf pound = %.0f TK\n",a,tk);
- }
- else if(x==5)
- {
- printf("\n\t\t\t\t\t\tAmount of Rupee :");
- scanf("%lf",&a);
- tk=a*1.20;
- printf("\n\n\t\t\t\t\t\t%0.2lf Rupee= %.0lf TK\n",a,tk);
- }
- cout<<"\n\n\t\t\t\t\t\tDo You Want To Exchange Money: "<<endl<<"\t\t\t\t\t\t1.Yes"<<endl<<"\t\t\t\t\t\t2.No";
- cout<<"\n\t\t\t\t\t\tEnter your Choice: ";
- cin>>y;
- if(y==1)
- {
- dp(tk);
- }
- else{
- return tk;
- }
- }
- int main()
- {
- string username;
- string password;
- char choice;char choice1;
- int n,z;
- cout<<" \t\t\t\t\t\t-------------------- "<<endl;
- cout<<" \t\t\t\t\t\t| Please Log in First | "<<endl;
- cout<<" \t\t\t\t\t\t-------------------- "<<endl;
- cout<<" \t\t\t\t\t\t"<<""<<endl<<endl;
- while (password != "1")
- {
- cout << "\t\t\t\t\t\t"<<"Username : ";
- getline(cin, username);
- if (username == "o")
- {
- cout << "\t\t\t\t\t\t"<<"Password : ";
- getline(cin, password);
- }
- if (password != "1")
- {
- cout <<endl<< "\t\t\t\t\t\t"<<"Wrong Input!!!!"<<endl;
- cout << "\t\t\t\t\t\t"<<"\n";
- cout << "\t\t\t\t\t\t"<<"@!!!!!!!!!!!!!!!!!!!!!!!@"<<endl;
- cout << "\t\t\t\t\t\t"<<" Access Denied!! " << std::endl;
- cout << "\t\t\t\t\t\t"<<"@!!!!!!!!!!!!!!!!!!!!!!!@"<<endl;
- cout << "\t\t\t\t\t\t"<<"\n";
- }
- else
- {
- cout << "\t\t\t\t\t\t"<<"\n";
- cout << "\t\t\t\t\t\t"<<"@########################@"<<endl;
- cout << "\t\t\t\t\t\t"<<"@^^^ Access Granted!! ^^^@"<<endl;
- cout << "\t\t\t\t\t\t"<<"@########################@"<<endl;
- cout << "\t\t\t\t\t\t"<<"\n";
- }
- }
- while(1)
- {
- cout<<endl<<endl<<endl<<endl<<endl;
- print();
- cout<<endl<<endl<<endl;
- cout<<" \t\t\t\t\t\t********MAIN MENU********\n"<<endl;
- cout<<" \t\t\t\t\t\t-------------------- ----------------------"<<endl;
- cout<<" \t\t\t\t\t\t| 1)MONEY EXCHANGE | | 3)CONVERTER RECORD |"<<endl;
- cout<<" \t\t\t\t\t\t-------------------- ----------------------\n\n"<<endl;
- cout<<" \t\t\t\t\t\t--------------- ----------"<<endl;
- cout<<" \t\t\t\t\t\t| 2)CONVERTER | | 4)EXIT |"<<endl;
- cout<<" \t\t\t\t\t\t--------------- ----------"<<endl;
- cout <<endl<<endl<< " \t\t\t\t\t\tPlease enter your choice : ";
- cin >> choice;
- cout << endl<<endl;
- if(choice=='1')
- {
- cout<<" \t\t\t\t\t\t***Choose Currency***"<<endl<<endl;
- cout<<"\t\t\t\t\t\tFor Taka press 1.\n\t\t\t\t\t\tFor Other press 2.\n";
- cout <<endl<< "\t\t\t\t\t\tPlease input your choice : ";
- cin>>choice1;
- if(choice1=='1')
- {
- cout<<endl<<" \t\t\t\t\t\tEnter amount of Taka:";
- cin>>n;
- dp(n);
- }
- else
- {
- convert();
- }
- }
- else if(choice=='2')
- {
- convert();
- }
- else if(choice=='3')
- {
- cout<< "\n\n\t\t\t\t\t\t!!!!! Not Yet Ready !!!!!"<<endl<<endl<<endl;
- }
- else if(choice=='4')
- {
- cout<< "\n\n\t\t\t\t\t\t##### Thank You..Bye #####"<<endl<<endl<<endl ;
- return 0;
- }
- cout<<"\n\n\n\t\t\t\t\t\tDo you want more Exchange: "<<endl;
- cout<<"\t\t\t\t\t\t1.Yes"<<endl;
- cout<<"\t\t\t\t\t\t2.No"<<endl;
- cout<<"\t\t\t\t\t\tEnter your choice: ";
- cin>>z;
- if(z==2)
- {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement