3153:练25.2 订餐时间(C、C++、python)

612 篇文章 3 订阅

3153:练25.2 订餐时间

信息学奥赛一本通-编程启蒙(C++版)在线评测系统

练 25.2 订餐时间

信息学奥赛一本通-编程启蒙(C++版)在线评测系统

https://www.bilibili.com/video/BV1rX4y1a7XR/

https://www.bilibili.com/video/BV18u4y1f7Z3/




C源码:

#include <stdio.h>
#include <stdlib.h>
int main()
{
	
	int sum=0,n,x,i;
	
	scanf("%d",&n);

	for(i=1;i<=n;i++)
	{
		scanf("%d",&x);
		sum+=x;
	}
	
	printf("%d",sum);

	return 0; 
}


C++代码:

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,a,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a;
		ans+=a;
	}
	cout<<ans;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int sum=0,n,a[1005];

	cin>>n;

	for(int i=1;i<=n;i++)
    {
		cin>>a[i];
		sum+=a[i];
	}

	cout<<sum;

	return 0; 
}


#include<stdio.h>
#include<stdlib.h>
int main()
{
	int sum=0,n,x,i;

	scanf("%d",&n);

	for(i=1;i<=n;i++)
	{
		scanf("%d",&x);
		sum+=x;
	}

	printf("%d",sum);

	return 0;
}



python3程序:

n=int( input() )

sum=0

lst=input().split()

for i in range( n):
            sum+=int(lst[i])

print( sum )



 




3023:【例6.3】 套盒子(Scratch、C、C++、python)

3023:【例6.3】 套盒子(Scratch、C、C++、python)_c++ 套盒子-CSDN博客

3024:练6.1 植树造林(Scratch、C、C++、python)

3024:练6.1 植树造林(Scratch、C、C++、python)-CSDN博客

3025:练6.2 兴趣小组(Scratch、C、C++、python)

3025:练6.2 兴趣小组(Scratch、C、C++、python)_兴趣小组c++-CSDN博客

3026:练6.3 整数的和(Scratch、C、C++、python)

3026:练6.3 整数的和(Scratch、C、C++、python)-CSDN博客

3027:【例7.1】保留3位小数(C、C++、python)

3027:【例7.1】保留3位小数(C、C++、python)-CSDN博客

3028:【例7.2】与圆相关的计算(Scratch、C、C++、python)

3028:【例7.2】与圆相关的计算(Scratch、C、C++、python)_3028:【例7.2】与圆相关的计算-CSDN博客

3029:练7.1 埃及金字塔(Scratch、C、C++、python)

3029:练7.1 埃及金字塔(Scratch、C、C++、python)_3029:练7.1 埃及金字塔 时间限制: 1000 ms 内存限制: 65536 kb 提交数: -CSDN博客




3020:练5.3 电影票(Scratch、C、C++)

3020:练5.3 电影票(Scratch、C、C++)_3020:练5.3 电影票-CSDN博客

3021:【例6.1】 比赛成绩(Scratch、C、C++、python)

3021:【例6.1】 比赛成绩(Scratch、C、C++、python)-CSDN博客

3022:【例6.2】捡石头(Scratch、C、C++、python)

3022:【例6.2】捡石头(Scratch、C、C++、python)_3022:【例6.2】捡石头-CSDN博客

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dllglvzhenfeng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值