Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "iostream"
- #include "iomanip"
- #include "math.h"
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- double n,i,k,l;
- k=l=0;
- cout<<"Enter n=";
- cin>>n;
- while ((n>=4) && (l<3))
- {
- i=n/4;
- if (i-int(i)==0) {k=k+n; l++; n=n-4;}
- else n--;
- }
- cout<<k<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment