Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,k,f;
- f = 0;
- cin >> n >> k;
- for (int i=1; i<=n; i++)
- {if (i%k == 0) {f++;}};
- cout << f << endl;
- int s;
- s = 0;
- cin >> n;
- for (int i=1;i<=n;i++)
- {
- if (i%2!=0) (s=s+i);
- };
- cout << s << endl;
- float a;
- int c1,c2,c3;
- c1=0;
- c2=0;
- c3=0;
- for(int i=0; i<8; i++)
- {
- cin >> a;
- if (a>0) c1++;
- if (a<0) c2++;
- if (a==0) c3++;
- }
- cout << c1 << endl;
- cout << c2 << endl;
- cout << c3 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement