Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- /*
- *
- */
- void ykaz(int *mas,int a);
- int main() {
- void (*ptr)(int *mas,int a);
- ptr=ykaz;
- int a;
- int *b = new int;
- cout << "Kol-vo chisel: ";
- cin >> a;
- for (int i = 0; i < a; i++) {
- cout << "Vvedite chislo: ";
- cin >> b[i];
- }
- ptr(b,a);
- return 0;
- }
- void ykaz(int *mas,int a){
- int c[4] = { 0,0,0,0 };
- for (int i = 0; i < a; i++) {
- if ((mas[i] % 3) == 0) {
- c[0]++;
- }
- }
- for (int i = 0; i < a; i++) {
- if ((mas[i] % 5) == 0) {
- c[1]++;
- }
- }
- for (int i = 0; i < a; i++) {
- if ((mas[i] % 7) != 0) {
- c[2]++;
- }
- }
- for (int i = 0; i < a; i++) {
- if ((mas[i] % 9) == 1) {
- c[3]++;
- }
- }
- cout << c[0] << c[1] << c[2] << c[3] << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement