评论

收藏

[Unix] #yyds干货盘点# 牛客网基础编程题 7 - 9

服务系统 服务系统 发布于:2021-12-17 12:27 | 阅读数:491 | 评论:0

DSC0000.png
#include<stdio.h>
int main()
{
  //使用ret保存printf的返回值
  int ret = printf("Hello world!");
  printf("\n");
  printf("%d\n", ret);
  return 0;
}
DSC0001.png
#include<stdio.h>
int main()
{
  int arr[4] = { 0 };
  int i = 0;
  int b = 0;
  for (i = 0; i < 3; i++)
  {
    scanf("%d", &arr[i]);
  }
  printf("score1=%d,score2=%d,score3=%d", arr[0], arr[1], arr[2]);
}
DSC0002.png
#include<stdio.h>
int main()
{
  int xuehao;
  float C = 0;
  float shuxue = 0;
  float yingyu = 0;
  scanf("%d;%f,%f,%f", &xuehao,&C,&shuxue,&yingyu);
  printf("The each subject score of  No. %d is %.2f, %.2f, %.2f.\n",xuehao,C,shuxue,yingyu);
  return 0;
}
</div>
    
    <div id="asideoffset"></div>

关注下面的标签,发现更多相似文章