题解 | #序列中删除指定数字#
序列中删除指定数字
https://www.nowcoder.com/practice/7bbcdd2177a445a9b66da79512b32dd7
#include <stdio.h> #define N 50 int main() { int n = 0; int arr[N] = {0}; int del = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); } scanf("%d", &del); for (int i = 0; i < n; i++) { if (del == arr[i]) { continue; } printf("%d ", arr[i]); } return 0; }