Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - //thanks God For Every Thing!
 - //contest link:
 - //#include<bits/stdc++.h>
 - #include<iostream>
 - #include<string>
 - #include<algorithm>
 - #include<cstdio>
 - #define pi acose(-1)
 - #define flush cin.ignore(numeric_limits<streamsize>::max(),'\n');
 - #define wow ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 - #define NL printf("\n")
 - using namespace std;
 - typedef long long int ll;
 - typedef double dl;
 - // ---------------------- slove---------------------------//
 - int int_ln(int x);
 - int main()
 - {
 - int a, b, c, i;
 - cin>>a>>b>>c;
 - cout<<"A = "<<a<<", B = "<<b<<", C = "<<c<<endl;
 - int ln1, ln2, ln3;
 - ln1 = int_ln(a);
 - ln2 = int_ln(b);
 - ln3 = int_ln(c);
 - //----------------space print-----------//
 - cout<<"A = ";
 - for( i=1; i<=10-ln1; i++)
 - {
 - cout<<" ";
 - }
 - cout<<a<<",";
 - cout<<" B = ";
 - for( i=1; i<=10-ln2; i++)
 - {
 - cout<<" ";
 - }
 - cout<<b<<",";
 - cout<<" C = ";
 - for( i=1; i<=10-ln3; i++)
 - {
 - cout<<" ";
 - }
 - cout<<c;
 - NL;
 - //-----------------zero print---------------//
 - cout<<"A = ";
 - for( i=1; i<=10-ln1; i++)
 - {
 - cout<<"0";
 - }
 - cout<<a<<",";
 - cout<<" B = ";
 - for( i=1; i<=10-ln2; i++)
 - {
 - cout<<"0";
 - }
 - cout<<b<<",";
 - cout<<" C = ";
 - for( i=1; i<=10-ln3; i++)
 - {
 - cout<<"0";
 - }
 - cout<<c;
 - NL;
 - //---------------last pace---------//
 - cout<<"A = "<<a;
 - for( i=1; i<=10-ln1; i++)
 - {
 - cout<<" ";
 - }
 - cout<<",";
 - cout<<" B = "<<b;
 - for( i=1; i<=10-ln2; i++)
 - {
 - cout<<" ";
 - }
 - cout<<",";
 - cout<<" C = "<<c;
 - for( i=1; i<=10-ln3; i++)
 - {
 - cout<<" ";
 - }
 - NL;
 - return 0;
 - }
 - int int_ln(int x)
 - {
 - int cnt=0, num;
 - while(x!=0)
 - {
 - cnt++;
 - num=x%10;
 - x/=10;
 - }
 - return cnt;
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment