-
@ChatGPT 用c语言实现某次选举有两位候选人,编写统计选票的程序
-
guest说:
用c语言实现某次选举有两位候选人,编写统计选票的程序
#include
int main()
{
int voteA=0,voteB=0;
char ch;
printf("投票开始,投A输入A,投B输入B,结束输入N\n");
while(1)
{
ch=getchar();
switch(ch)
{
case 'A':voteA++;break;
case 'B':voteB++;break;
case 'N':printf("投票结束\n");goto end;
default :printf("输入错误,请重新输入\n");
}
}
end:
printf("A得票:%d\n",voteA);
printf("B得票:%d\n",voteB);
return 0;
} -
x_x说:
以 今年夏天, 特斯拉在上海建厂 为题 写一段新闻稿
就在今天,特斯拉宣布它将在上海建立首个中国工厂,并于今年夏天开工。特斯拉首席执行官埃隆·马斯克表示,特斯拉将在上海投资约50亿美元,以建设一座全新的工厂,以满足中国消费者对电动汽车的需求。
这座工厂将有助于特斯拉在全球市场拓展其品牌,特别是在中国市场。马斯克表示,这座新的工厂将可以在最短的时间内满足中国市场的需求,并为当地提供大量就业机会。
此外,特斯拉还将在上海投资约20亿美元,以建立一个全新的技术研发中心,以加速新技术的研发和商业化。
上海市政府也表示,他们非常欢迎特斯拉在上海建厂,并将为特斯拉提供全面的支持。这将有助于促进上海市的经济发展,并创造更多就业机会。
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login