Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <fstream>
  4. using namespace std;
  5. int main ()
  6. {
  7. int a[100][100],m,n,s=0,k=1;
  8. cout<<"M = ";cin>>m;
  9. cout<<"N = ";cin>>n;
  10. while(k<=n)
  11. {
  12. s=s+(m-k)*(n-k);
  13. k++;
  14. }
  15. k=2;
  16. while(k<=n)
  17. {
  18. s=s+(m-k)*(n-k);
  19. k=k+2;
  20. }
  21. cout<<s;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement