掉石頭

 avatar
user_3763047219
c_cpp
3 years ago
480 B
3
Indexable
#define _CRT_SCURE_NO_WARNINGS
#include <iostream>

int main(){
	int* st;
	int stone[299];
    scanf("%d", &stone);
	int i = 0;
	int max=stone[0];
	while (stone[i] > 0) {
		if (max < stone[i + 1]) {
			max = stone[i+1];
			i = i + 1;
		}
	}
	int j = 0;
	int arr[100];
	while (stone[j] > 0) {
		arr[stone[j]] = arr[stone[j]] + 1;
		j=j + 1;
	}

	int k = 0;
	int ans = 0;
	while (max > 0) {
		if (arr[k] = 2) {
			ans = k;
		}
	}
	printf("%d,ans");
}
Editor is loading...