首页 > 其他分享 >task2.c

task2.c

时间:2023-03-05 21:33:41浏览次数:34  
标签:task2 源代码 int sum main 写法

源代码:

#include <stdio.h>
int main()
{
  int n, sum;
  scanf("%d",&n);
  sum=n*(n+1)/2;
  printf("sum = %d\n", sum);
return 0;
}

 图片:

结论:写法1与写法2可以满足要求

 

标签:task2,源代码,int,sum,main,写法
From: https://www.cnblogs.com/zzaw/p/17181733.html

相关文章

  • PyTorch图像分类实战task2——预训练模型预测
    预训练图像分类模型预测视频链接:https://www.bilibili.com/video/BV1qe4y1D7zD/?spm_id_from=pageDriver&vd_source=ec0dfe3d40081b44c0160eacc0f39d0f脚本文件:https://g......
  • 【王喆-推荐系统】前沿篇-(task2)GNN在Pinterest的应用
    学习总结(1)GraphSAGE的主要步骤是三步“采样-聚合-预测”:采样是指在整体图数据上随机确定中心节点,采样k阶子图样本。聚合是指利用GNN把k阶子图样本聚合成中心节点......
  • task2-3
    #include<stdio.h>#include<math.h>intmain(){floatF,C;while(scanf_s("%f",&C)!=EOF){F=9*C/5+32;printf("摄......
  • task2
    #include<stdio.h>#include<math.h>intmain(){doublex,ans;while(scanf("%lf",&x)!=EOF){ans=pow(x,365);printf("%.2f的365......
  • task2.3
    #include<stdio.h>#include<math.h>intmain(){doublex,ans;while(scanf("%lf",&x)!=EOF){ans=9.0/5.0*x+32.0;printf("摄氏度c=%.2lf;华氏度f=%.2lf\n",x,ans)......