标签:字符 result The 天都 注意 printf ons strong gen
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12395220.html
1.算菜价(22min)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2090
int main() { char vegname[100]; double count; double prise; double sum=0; while (scanf_s("%s%lf%lf", vegname,100,&count,&prise)!=EOF ) { sum += count * prise; } printf("%0.1lf\n", sum); return 0; }
2.Fibbonacci Number(50min)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2070
#include<stdio.h> #include<math.h> #include<stdlib.h> #include<string.h> int main() { int n; _int64 result[10000]; while (~scanf_s("%d",&n)) { if (n == -1) break; result[0] = 0; result[1] = 1; int i = 0; for (i = 2; i <= n; i++) result[i] = result[i - 1] + result[i - 2]; printf("%I64d\n", result[n]); } return 0; }
标签:字符 result The 天都 注意 printf ons strong gen
原文地址:https://www.cnblogs.com/ping2yingshi/p/12395220.html