当前位置:网站首页>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;
}边栏推荐
- 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
- Swagger2 quick start and use
- Future source code view -juc series
- Interview script of Software Test Engineer
- Similarities and differences of text similarity between Jaccard and cosine
- Software testers, how can you quickly improve your testing skills? Ten minutes to teach you
- [about text classification trick] things you don't know
- A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
- Global and Chinese market of breast cancer imaging 2022-2028: Research Report on technology, participants, trends, market size and share
- Analysis: misunderstanding of choosing WMS warehouse management system
猜你喜欢
![[cloud native topic -48]:kubesphere cloud Governance - operation - overview of multi tenant concept](/img/b4/961b3b44e9ecbfd4bddd04318b663a.jpg)
[cloud native topic -48]:kubesphere cloud Governance - operation - overview of multi tenant concept

STM32 GPIO CSDN creative punch in
![[common error] UART cannot receive data error](/img/77/6ba56ce6e64beeb73a77d04af5bd0f.jpg)
[common error] UART cannot receive data error

From functional testing to automated testing, how did I successfully transform my salary to 15K +?

GUI 应用:socket 网络聊天室

Makefile judge custom variables

Att & CK actual combat series - red team actual combat - V

Regular expressions and text processors for shell programming
![[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)

Test the influence of influent swacth on the electromagnetic coil of quartz meter
随机推荐
HR disgusted interview behavior
It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
不得不会的Oracle数据库知识点(一)
BBS forum recommendation
From functional testing to automated testing, how did I successfully transform my salary to 15K +?
P1629 postman delivering letter
[common error] custom IP instantiation error
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
The difference between fetchtype lazy and eagle in JPA
Is it really possible that the monthly salary is 3K and the monthly salary is 15K?
[PHP basics] cookie basics, application case code and attack and defense
Struct in linked list
Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution
A method to solve Bert long text matching
Future source code view -juc series
Wechat official account and synchronization assistant
我管你什么okr还是kpi,PPT轻松交给你
Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing
What is the potential of pocket network, which is favored by well-known investors?