Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x;
- cin>>x;
- while(x>99){
- if(x==1000){
- x=1;
- }
- if(x>99 && x<1000){
- if(x%100==0){
- x=x/100;
- }else if(x%10==0) {
- x=(x/100)*((x/10)%10);
- }else if((x/10)%10==0){
- x=(x/100)*(x%10);
- }
- }
- }
- while(x<100 && x>9){
- if(x<100 && x>9){
- if(x%10==0){
- x=x/10;
- }else{
- x=(x/10)*(x%10);
- }
- }
- }
- cout<<x<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment