Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #define p sqrt(base*base+height*height)
- //p is hypotenuse of my triangles
- using namespace std;
- int main()
- {
- int sum=0, r, base, height;
- cin>>r;
- height=r-1;
- for (base=1; base<r; base++)
- {
- while(p>r)
- {
- height--;
- }
- sum+=height;
- }
- sum*=4;
- cout<<sum<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement