From 4afd00924078d7d1272287c581a03f7bffc54d5c Mon Sep 17 00:00:00 2001 From: smallkun Date: Mon, 31 Mar 2025 18:13:34 +0800 Subject: [PATCH] Auto commit --- 万维调考试题源码/1-1.c | 36 +++++++++++++++++++++++++++++++++ 万维调考试题源码/1-2.c | 28 ++++++++++++++++++++++++++ 万维调考试题源码/2-1.c | 43 ++++++++++++++++++++++++++++++++++++++++ 万维调考试题源码/2-2.c | 31 +++++++++++++++++++++++++++++ 万维调考试题源码/3-A-1.c | 38 +++++++++++++++++++++++++++++++++++ 万维调考试题源码/3-A-2.c | 42 +++++++++++++++++++++++++++++++++++++++ 万维调考试题源码/3-B-1.c | 29 +++++++++++++++++++++++++++ 万维调考试题源码/3-B-2.c | 32 ++++++++++++++++++++++++++++++ 8 files changed, 279 insertions(+) create mode 100644 万维调考试题源码/1-1.c create mode 100644 万维调考试题源码/1-2.c create mode 100644 万维调考试题源码/2-1.c create mode 100644 万维调考试题源码/2-2.c create mode 100644 万维调考试题源码/3-A-1.c create mode 100644 万维调考试题源码/3-A-2.c create mode 100644 万维调考试题源码/3-B-1.c create mode 100644 万维调考试题源码/3-B-2.c diff --git a/万维调考试题源码/1-1.c b/万维调考试题源码/1-1.c new file mode 100644 index 0000000..059ecaa --- /dev/null +++ b/万维调考试题源码/1-1.c @@ -0,0 +1,36 @@ +/*----------------------------------------------------------------------- +ơ +------------------------------------------------------------------------- +Ŀڴ˳Уfun Ĺ:ʮm תk(1 +// +void fun(int m, int k); +int main() +{ + int m, k; + printf("ʮm ͽk1 < k < 26"); + scanf("%d %d", &m, &k); + if (k <= 1 || k >= 26) + { + printf("k ֵ 2 25 ֮䡣\n"); + return 1; + } + fun(m, k); + return 0; +} +void fun(int m, int k) +{ + char result[65]; + int remainder, i; + int index = 63; + result[64] = '\0'; + /**********Program**********/ + + /********** End **********/ + printf("\n"); +} \ No newline at end of file diff --git a/万维调考试题源码/1-2.c b/万维调考试题源码/1-2.c new file mode 100644 index 0000000..a572bca --- /dev/null +++ b/万维调考试题源码/1-2.c @@ -0,0 +1,28 @@ +/*----------------------------------------------------------------------- +ơ +------------------------------------------------------------------------- +Ŀһn,n ΧһȦ˳źšӵһ˿ʼ +(1 3 )3 ˳Ȧӣµԭڼŵλ + +n: 99 +µԭ88 ŵλ +------------------------------------------------------------------------- +ע⣺ĶеݣҪԶ +------------------------------------------------------------------------*/ +#include +int josephus(int n) +{ + /**********Program**********/ + + /********** End **********/ +} +int main() +{ + int n; + int result; + printf("n: "); + scanf("%d", &n); + result = josephus(n); + printf("µԭ%d ŵλ\n", result); + return 0; +} \ No newline at end of file diff --git a/万维调考试题源码/2-1.c b/万维调考试题源码/2-1.c new file mode 100644 index 0000000..cbc1b94 --- /dev/null +++ b/万维调考试题源码/2-1.c @@ -0,0 +1,43 @@ +/*----------------------------------------------------------------------- +ơ +----------------------------------------------------------------------- +дż֮ͣ +ʾ +100 222 656 899 65 +еż֮Ϊ978 +------------------------------------------------------------------------- +ע⣺Ķеݣ¶ +------------------------------------------------------------------------*/ +#include +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 **********/ +} diff --git a/万维调考试题源码/2-2.c b/万维调考试题源码/2-2.c new file mode 100644 index 0000000..a07078b --- /dev/null +++ b/万维调考试题源码/2-2.c @@ -0,0 +1,31 @@ +/*----------------------------------------------------------------------- +ơ +----------------------------------------------------------------------- +涨ַֻĸ*šдfun书:ַеǰ +*ȫ +ɾ мβ* Ųɾ磬 ַе +:"*******A*BC*DEF*G****"ɾ +ַдеӦ:"A*BC*DEF*G****"дʱʹC +ṩַ + +------------------------------------------------------------------------- +ע:Ķmain еκ, +ںfun Ļд,Զ± +Զ +------------------------------------------------------------------------*/ +#include +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); +} diff --git a/万维调考试题源码/3-A-1.c b/万维调考试题源码/3-A-1.c new file mode 100644 index 0000000..4872295 --- /dev/null +++ b/万维调考试题源码/3-A-1.c @@ -0,0 +1,38 @@ +/*----------------------------------------------------------------------- +ơ +----------------------------------------------------------------------- +дҳͬʱ3 25 37 2 +£ +ʼֵ: 1 +Ľֵ: 100 +23 +------------------------------------------------------------------------- +ע:Ķmain еκ, +ںisMeetCondition Ļд,Զ± +Զ +------------------------------------------------------------------------*/ +#include +int isMeetCondition(int num); +int main() +{ + int start, end; + int i; + printf("ʼֵ: "); + scanf("%d", &start); + printf("Ľֵ: "); + scanf("%d", &end); + for (i = start; i <= end; i++) + { + if (isMeetCondition(i)) + { + printf("%d\n", i); + } + } + return 0; +} +int isMeetCondition(int num) +{ + /**********Program**********/ + + /********** End **********/ +} diff --git a/万维调考试题源码/3-A-2.c b/万维调考试题源码/3-A-2.c new file mode 100644 index 0000000..c155cc7 --- /dev/null +++ b/万维调考试题源码/3-A-2.c @@ -0,0 +1,42 @@ +/*----------------------------------------------------------------------- +ơ +----------------------------------------------------------------------- +һжһַǷһַַҪָʵ֡ +£ +һַ:abcdefg1234qwert +ڶַ:4q +ַ'4q'ַ'abcdefg1234qwert'ַ +------------------------------------------------------------------------- +ע⣺Ķеݣ¶ +------------------------------------------------------------------------*/ +#include +#include +// жַ +int isSubstring(char *str1, char *str2); +int main() +{ + char str1[100], str2[100]; + printf("һַ:"); + gets(str1); + printf("ڶַ:"); + gets(str2); + if (isSubstring(str1, str2)) + { + printf("ַ'%s'ַ'%s'ַ\n", str2, str1); + } + else + { + printf("ַ'%s'ַ'%s'ַ\n", str2, str1); + } + return 0; +} +int isSubstring(char *str1, char *str2) +{ + int len1 = strlen(str1); + int len2 = strlen(str2); + int i, j; + /**********Program**********/ + + /********** End **********/ + return 0; +} diff --git a/万维调考试题源码/3-B-1.c b/万维调考试题源码/3-B-1.c new file mode 100644 index 0000000..d17fec6 --- /dev/null +++ b/万维调考试题源码/3-B-1.c @@ -0,0 +1,29 @@ +/*----------------------------------------------------------------------- +ơ +------------------------------------------------------------------------- +Ŀһַո񣬳Ȳ100ɾַе +ַ + +ַI will graduate from high school in June 2025 +ȥַֺΪI will graduate from high school in June +------------------------------------------------------------------------- +ע⣺Ķеݣ¶ +------------------------------------------------------------------------*/ +#include +#include +int main() +{ + char a[100], b[100]; + int l, i, j; + printf("ַ"); + gets(a); + l = strlen(a); + j = 0; + /**********Program**********/ + + /********** End **********/ + b[j] = '\0'; + printf("ȥַֺΪ"); + puts(b); + return 0; +} diff --git a/万维调考试题源码/3-B-2.c b/万维调考试题源码/3-B-2.c new file mode 100644 index 0000000..b643db6 --- /dev/null +++ b/万维调考试题源码/3-B-2.c @@ -0,0 +1,32 @@ +/*----------------------------------------------------------------------- +ơ +------------------------------------------------------------------------- +Ŀ³Ĺɾȥһάstr ͬʹֻ֮ʣһ +еѰС˳Уɾݵĸ +һάеǣ +2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 9 +ǣ2 3 4 5 6 7 8 9 +------------------------------------------------------------------------- +ע⣺Ķеݣ¶ +------------------------------------------------------------------------*/ +#include +int del(int str[], int n) +{ + int i, j = 1; + /**********Program**********/ + + /********** End **********/ +} +int main() +{ + int str[] = {2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9}; + int i, m, n = sizeof(str) / sizeof(int); + for (i = 0; i < n; i++) + printf("%d ", str[i]); + m = del(str, n); + printf("\n"); + for (i = 0; i < m; i++) + printf("%d ", str[i]); + printf("\n"); + return 1; +}