Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cmath>
- using namespace std;
- int a[303]={0}, b;
- ifstream in("input.txt");
- ofstream out("output.txt");
- void outArray(){
- for (int i=a[0];i>0;i--)
- out << a[i];
- out << endl;
- }
- int main(){
- a[0]=1;
- a[1]=1;
- in >> b;
- for (int j=1; j<=b; j++)
- {
- for (int i=1; i<=a[0]; i++)
- a[i] *= 2;
- for (int i=1; i<=a[0]; i++)
- if (a[i] >= 10)
- {
- a[i+1] += (a[i]-a[i]%10)/10;
- a[i] %= 10;
- if (a[0]==i)
- a[0]++;
- }
- }
- outArray();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement