10 2024 档案
摘要:1:在C++语⾔中,整型、实数型、字符型、布尔型是不同数据类型,这四种类型的变量间都可以⽐较⼤⼩。 2:C++中,定义变量 int a=5,b=4,c=3 ,则表达式 (a<b<c) 无法运行。 3:IPv4版本的因特网总共有(126 )个A类地址网络。 4:【阿尔法:2279: 【例27.1】 求
阅读全文
摘要:include <bits/stdc++.h> using namespace std; int main( ) { char a; cin >> a; cout << " " << a << endl; cout << " " << a << a << a << endl; cout << a <
阅读全文
摘要:include <bits/stdc++.h> using namespace std; int main( ) { char a; cin >> a; cout << char(a-32); return 0; } // 反思1: cin >> a; 忘记写了 反思2: +是转为小写字母-是转为大
阅读全文
摘要:include <bits/stdc++.h> using namespace std; int n; int main( ) { cin >> n; cout << n/100 << endl; n=n%100; cout << n/50 << endl; n=n%50; cout << n/20
阅读全文
摘要:include <bits/stdc++.h> using namespace std; double z, c, p; int main( ) { cin >> z >> c >> p; cout << z/10020+c/10030+p/100*50; return 0; } 反思:设定的代码块
阅读全文
摘要:include <bits/stdc++.h> using namespace std; double r, pi=3.14; int main( ) { cin >> r; cout << fixed << setprecision(2)<< 4.0/3.0pirrr; return 0; } 球
阅读全文
摘要:include <bits/stdc++.h> using namespace std; double r, pi=3.14159; int main() { cin >> r; cout << fixed << setprecision(4) << r2 << " "; cout << fixed
阅读全文
摘要:【题目描述】 给出一个整数a 和一个正整数n(−1000000≤a≤1000000,1≤n≤10000) ,求乘方an ,即乘方结果。最终结果的绝对值不超过1000000 。 【输入】 一行,包含两个整数a 和n 。−1000000≤a≤1000000,1≤n≤10000 。 【输出】 一个整数,即
阅读全文
摘要:【题目描述】 菲波那契数列是指这样的数列: 数列的第一个和第二个数都为1,接下来每个数都等于前面2个数之和。给出一个正整数k,要求菲波那契数列中第k个数是多少。 【输入】 输入一行,包含一个正整数k。(1 ≤ k ≤ 46) 【输出】 输出一行,包含一个正整数,表示菲波那契数列中第k个数的大小。 【
阅读全文
摘要:【题目描述】 输出一个整数序列中与指定数字相同的数的个数。输入包含2行:第1行为N和m,表示整数序列的长度(N<=100)和指定的数字;第2行为N个整数,整数之间以一个空格分开。输出为N个数中与m相同的数的个数。 【输入】 第1行为N和m,表示整数序列的长度(N<=100)和指定的数字, 中间用一个
阅读全文