Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3317 邓小龙 单价最高的书 C++ Runtime Error 0 MS 264 KB 564 2024-05-17 10:58:00

Tests(0/2):


Code:

#include<iostream> using namespace std; struct book{ int hao; char name; int num; int m; }; struct book book1[101]; int main(){ int n,man,k; cin>>n; for(int i=0;i<n;i++){ cin>>book1[i].hao>>book1[i].name>>book1[i].num>>book1[i].m; } man=book1[0].m/book1[0].num; for(int i=1;i<n;i++){ if(book1[i].m/book1[i].num>man) man=book1[i].m/book1[i].num; k++; } cout<<book1[k].hao<<" "<<book1[k].name<<" "<<book1[k].num<<" "<<book1[k].m<<" "<<man; return 0; }


Run Info:

Runtime Error:Floating point exception