с++, в цикле перебираю элементы массива, введённые с клавиатуры , почему не могу ими воспользоваться после цикла? #include
#include
#include
using namespace std;
int main() {
int y, a, b, k, n;
cin >> n;
int arr[100];
for (int i = 0; i < n; i++) {
cin >> a;
arr[i] = a;
}
cin >> k;
int x = 1;
for (int i = 0; i < n; i++) {

if (arr[i] = k) {
cout << x;
return 0;
}else
x += 1;
}
system("pause");
return 0;
}
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.