Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int szostkowy(int d,int C[50])
- {
- int s=0;
- int i=0;
- while(i<d)
- {
- s+=C[i]*pow(6,i);
- i++;
- }
- return s;
- }
- int main()
- {
- int d,C[50];
- cout<<"Wprowadz d: ";
- cin>>d;
- cout<<"Wprowadz tablice C "<<endl;
- for(int i=0;i<d;i++)
- {
- cin>>C[i];
- }
- int s = szostkowy(d,C);
- cout<<"Wartosc liczy w szostkowym wynosi: "<<s<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement