Auto commit

This commit is contained in:
smallkun 2025-03-31 18:23:49 +08:00
parent 4afd009240
commit 2c6fa871fd
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,43 @@
/*-----------------------------------------------------------------------
-----------------------------------------------------------------------
100 222 656 899 65
978
-------------------------------------------------------------------------
------------------------------------------------------------------------*/
#include <stdio.h>
int sum_of_even(int arr[], int size);
int main()
{
int numbers[5];
int i;
int even_sum;
printf("【请输入五个正整数:】");
for (i = 0; i < 5; i++)
{
if (scanf("%d", &numbers[i]) != 1)
{
printf("输入有误,请确保输入了五个整数。\n");
return 1;
}
if (numbers[i] <= 0)
{
printf("输入有误!请确保输入的是正数。\n");
return 1;
}
}
even_sum = sum_of_even(numbers, 5);
printf("【这五个正整数中的偶数之和为:】%d\n", even_sum);
return 0;
}
int sum_of_even(int arr[], int size)
{
int sum = 0;
int i;
/**********Program**********/
/********** End **********/
}

View File

@ -0,0 +1,31 @@
/*-----------------------------------------------------------------------
-----------------------------------------------------------------------
*fun:
*
*
:"*******A*BC*DEF*G****"
:"A*BC*DEF*G****"使C
-------------------------------------------------------------------------
:main ,
fun ,
------------------------------------------------------------------------*/
#include <stdio.h>
void fun(char *a)
{
/**********Program**********/
/********** End **********/
}
main()
{
char s[81];
printf("【Enter a string:】\n");
gets(s);
fun(s);
printf("【The string after deleted:】\n");
puts(s);
}