以下不合法的用户标识符是: A. j2_KEY B. _8_ C. 4d D. dobule 为什么?
时间: 2024-05-31 14:10:04 浏览: 31
不合法的用户标识符是:
A. j2_KEY - 含有非法字符 "_",标识符只能包含字母、数字和下划线,并且不能以数字开头。
B. _8_ - 合法的标识符,因为只包含字母、数字和下划线。
C. 4d - 非法的标识符,因为以数字开头。
D. dobule - 非法的标识符,正确的拼写应该是 double。
相关问题
Problem B: 编写函数:输出数据类型 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 482 Solved: 239 [Submit][Status] Description 根据append.cc中的代码,编写一个能输出数据类型的函数printData()。 Input 输入3行,第一行是一个字母,第二行是一个整数,第三行是一个实数。 Output 输出有3行,分别于上述三行输入一一对应,具体格式见题目描述和样例。 Sample Input C 3 3.4 Sample Output C is a character. 3 is an integer. 3.4 is a dobule. HINT Append Code append.cc,
以下是符合要求的程序:
#include <iostream>
using namespace std;
void printData(char c, int i, double d) {
cout << c << " is a character." << endl;
cout << i << " is an integer." << endl;
cout << d << " is a double." << endl;
}
int main() {
char c;
int i;
double d;
cin >> c >> i >> d;
printData(c, i, d);
return 0;
}