Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream df("U1.txt");
- ofstream rf("U1rez.txt");
- int n;
- df>>n;
- int a[80],i,suma=0;
- for(i=2;i<=n;i++)
- {
- a[i]=a[i-1]+a[i-2];
- suma=suma+a[i-1]+a[i-2];
- }
- rf<<a[n];
- df.close();
- rf.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement