#include <stdio.h> int main(){ int n; char gender; double height; double t; if (scanf("%d",&n)!=EOF){ double target[10]; int count=0; for(int i=0;i<n;i++){ if (scanf(" %c %lf",&gender,&height)!=EOF){ // printf("%d %d %c %lf\n",n,i,gender,height); if (gender=='F'){t=height*1.09;target[count]=t;count++;} if (gender=='M'){t=height/1.09;target[count]=t;count++;} // printf("%d %d %c %lf\n",n,i,gender,height); } } for (int i=0;i<n;i++){ printf("%.2f\n",target[i]); } } else{ printf("input wrong"); } return 0; }
c语言编程练习题:7-129 最佳情侣身高差
作者:yunjinqi
类别:编程
日期:2023-05-31 16:51:23
阅读:621 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/254
最新文章
系统当前共有 404 篇文章