Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <math.h>
- using namespace std;
- int n,liczba,c;
- float sn=0,fx;
- int main()
- {
- cin>>n;
- for(int i=1; i<=n; i++)
- {
- while(1)
- {
- c=i/2;
- if (c=1){
- fx=i*i;
- cout<<"i= "<<i<<endl<<" fx= "<<fx<<endl; break;
- }
- else if (c=0){
- fx=i+100;
- cout<<"i= "<<i<<endl<<" fx= "<<fx<<endl;} break;
- }
- sn=sn+fx;
- }
- cout<<"suma= "<<sn;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement