跳至主要內容
Big O

1. 数组遍历问题

考虑以下代码片段:

for (int i = 0; i < n; i++) {
    printf("%d ", i);
}

AI悦创原创...大约 13 分钟Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考
2023SM1-Midterm 刷题

Exercise 1:

#include <stdio.h>
#include <stdbool.h>
#include <ctype.h>  // 用于tolower函数

bool is_vowel(char c) {
    c = tolower(c);  // 转为小写,以便处理大小写情况
    return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}

int main() {
    char ch;
    int count = 0;  // 用于统计元音的数量

    printf("Enter a line: ");
    while ((ch = getchar()) != '\n') {  // 逐个读取字符,直到读到换行符为止
        if (is_vowel(ch)) {
            count++;
        }
    }

    printf("Number of vowels: %d\n", count);
    return 0;
}

AI悦创原创...大约 4 分钟Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考
墨尔本大学C语言期中考

1. Ex7.04: Integer frequencies

1.1 Task

Write a program that reads as many as 1,000 integer values, and counts the frequency of each value in the input.

编写一个程序,读取多达 1000 个整数值,并计算输入中每个值的频率。

1.2 Sample output

There are no tabs in the output.


AI悦创原创...大约 5 分钟Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考
comp10002 Foundations of Algorithms

School of Computing and Information Systems

计算机与信息系统学院

comp10002 Foundations of Algorithms

《算法基础》

Mid-Semester Practice Test, August 2023

2023年8月的期中实践测试

Time Allowed: Forty-five minutes.

时间限制:45分钟。


AI悦创原创...大约 19 分钟Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考Python 一对一教学墨尔本大学C语言辅导墨尔本大学C语言一对一辅导墨尔本大学C语言期中考