Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main(int argc, char *argv[])
- {
- int n;
- cout << "Podaj ilosc liczb:" << endl;
- cin >> n;
- int tab[n];
- int sum = 0;
- for(int i = 0; i < n; i++){
- cout << "Podaj wartosc " << i+1 << "-ej liczby:" << endl;
- cin >> tab[i];
- }
- for(int i = 0; i < n; i++)
- {
- if(tab[i]%7 == 0){
- sum ++;
- }
- }
- cout<<"--------------------------------"<<endl;
- cout << endl << "Ilosc liczb podzielnych przez 7 wynosi:" << sum << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement