Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Welcome to GDB Online.
- GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
- C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
- Code, Compile, Run and Debug online from anywhere in world.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- int main()
- {
- int n = 0;
- do{
- cout<<"Vavedi n = ";
- cin >> n;
- } while (n < 1);
- int a[n];
- for(int i = 0; i < n; i++){
- cout << "a" << i << " = ";
- cin >> a[i];
- }
- int num;
- cout << "Vavedi turseno chislo: ";
- cin >> num;
- int count = 0;
- for(int i = 0; i < n; i++){
- if(a[i] == num){
- count++;
- }
- }
- cout << "Chisloto " << num << " se sreshta " << count;
- if(count == 1) {
- cout << " put\n";
- } else {
- cout << " puti\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement