Facebook
From Raper, 4 Years ago, written in C++.
This paste is a reply to potęgowanie from Raper - go back
Embed
Viewing differences between potęgowanie and Re: potęgowanie
\n\n
#include 

using namespace std;

int separacja(int s)
{
    int a=0;
    int b=0;
    for(int i=s; i>=10; i-=10)
    {
        if(i >=10)
        {
            a++;
            b=i;
        }
        else
        {
            cout << a << " " << b <         }
    }
    
}

int potegowanie(int a[], int b[], int d)
{
    int suma=1;
    for(int i=0; i     {
        if(1 <= a[i] <= 1000000000 || 1 <= b[i] <= 1000000000)
        {
            for(int j=1; j<=b[i]; j++)
            {
                suma *= a[i];
            }
            cout << suma << endl; 
            separacja(suma);
            suma = 1;
            
            
        }
        else return 0;
    }
    return 0;
    
}

int main()
{
    int D =0;
    int a[10];
    int b[10];
    
    cin >> D;
    if(1<=D<=100)
    {
        for(int i=0; i         {
            cin >> a[i];
            cin >> b[i];
        }
        
       potegowanie(a, b, D);
    }
    else
        return 0;
        
    return 0;
}