当前位置:网站首页>Delete all elements with a value of Y. The values of array elements and y are entered by the main function through the keyboard.
Delete all elements with a value of Y. The values of array elements and y are entered by the main function through the keyboard.
2022-07-04 00:41:00 【CTGU-Yoghurt】
subject :
Delete all values as y The elements of . The sum of the values in the array elements y The value of is determined by
The main function inputs... Through the keyboard .
Code details :
#include <stdio.h>
#include<conio.h>
#include<stdio.h>
#define M 20
void fun(int bb[], int* n, int y)
{
/**********Program**********/
for (int i = 0; i < *n;)
{
if (bb[i] == y) {
for (int j = i; j < *n; j++)
{
bb[j] = bb[j + 1];
}
(* n)--;// notes :-- The priority is * In front of , So expand with parentheses
}
else i++;
}
/********** End **********/
}
int main()
{
int aa[M], n, y, k;
printf("\nPlease enter n:"); scanf("%d", &n);
printf("\nEnter %d positive number:\n", n);
for (k = 0; k < n; k++) scanf("%d", &aa[k]);
printf("The original data is:\n");
for (k = 0; k < n; k++) printf("%5d", aa[k]);
printf("\nEnter a number to deletede:"); scanf("%d", &y);
fun(aa, &n, y);
printf("The data after deleted %d:\n", y);
for (k = 0; k < n; k++) printf("%4d", aa[k]);
printf("\n");
return 0;
}边栏推荐
- Sequence list and linked list
- BBS forum recommendation
- Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
- 基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
- 网上的低佣金链接安全吗?招商证券怎么开户?
- P1339 [USACO09OCT]Heat Wave G
- It is worthy of "Alibaba internal software test interview notes" from beginning to end, all of which are essence
- ITK learning notes (VII) the position of ITK rotation direction remains unchanged
- 【leetcode】374. Guess the size of the number
- From functional testing to automated testing, how did I successfully transform my salary to 15K +?
猜你喜欢

STM32 key light
![[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!](/img/3f/75b3125f8779e6cf9467a30fd7eeb4.jpg)
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!

Entropy and full connection layer
![[prefix and notes] prefix and introduction and use](/img/a6/a75e287ac481559d8f733e6ca3e59c.jpg)
[prefix and notes] prefix and introduction and use
![[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)](/img/44/aa4963d07d046deb2bc76eb59f8ff7.jpg)
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
![[NLP] text classification still stays at Bert? Duality is too strong than learning framework](/img/49/1ff6025bdb0445e5638c1451e0b267.jpg)
[NLP] text classification still stays at Bert? Duality is too strong than learning framework

Unity elementary case notes of angry birds Siki college 1-6

Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools

STM32 GPIO CSDN creative punch in

A dichotomy of Valentine's Day
随机推荐
Detailed explanation of the relationship between Zhongtai, wechat and DDD
[PHP basics] cookie basics, application case code and attack and defense
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
Eight year test old bird, some suggestions for 1-3 year programmers
Solution to the impact of Remote Code Execution Vulnerability of log4j2 component on December 9, 2021
【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
ISBN number
From functional testing to automated testing, how did I successfully transform my salary to 15K +?
不得不会的Oracle数据库知识点(二)
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
Severity code description the project file line prohibits the display of status error c4996 fopen ('fscanf ', StrCmp): this function or variable may be unsafe The most comprehensive solution
12. Go implementation of integer to Roman numeral and leetcode
[PHP basics] session basic knowledge, application case code and attack and defense
Struct in linked list
BBS forum recommendation
AI Challenger 2018 text mining competition related solutions and code summary
The FISCO bcos console calls the contract and reports an error does not exist
The first training of wechat applet
机器学习基础:用 Lasso 做特征选择
Is the securities account opened by Caicai for individuals safe? Is there a routine