while语句语法:while(循环条件){循环语句}只要循环条件为真就会执行循环语句,直到不为真时退出循环#include <iostream>
#include<iomanip>
using namespace std;
i...
阅读全文...
C++-9-三目运算符和switch语句
三目运算符表达式1?表达式2:表达式3当表达式1为真时,执行并返返回表达式2,否则执行并返回表达式3#include<iostream>
using namespace std;
int main()
{
cout << ...
阅读全文...
阅读全文...
C++-8-if语句
单行if语句if (条件) {当条件为真时执行的语句}#include<iostream>
#include<cmath>
using namespace std;
int main() {
cout << &...
阅读全文...
阅读全文...
2025年9月22日leetcode每日一题3005. 最大频率元素计数
class Solution:
def maxFrequencyElements(self, nums: List[int]) -> int:
ha_sh= {}
for i in nums:
...
阅读全文...
阅读全文...