为什么这道题会WA描述Given N arithmetic expressions,can you tell whose result is closest to 输入Line 1:N (1

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 01:51:21

为什么这道题会WA描述Given N arithmetic expressions,can you tell whose result is closest to 输入Line 1:N (1
为什么这道题会WA
描述
Given N arithmetic expressions,can you tell whose result is closest to
输入
Line 1:N (1

为什么这道题会WA描述Given N arithmetic expressions,can you tell whose result is closest to 输入Line 1:N (1
#include
#include
#include
#include
int main()
{
int N=0,i=0,j=0,pa,pb;
int index =0;
\x05double sum=10;
char oper = '+';
double * res;
scanf("%d\n",&N);
res = (double *)malloc(N*8);
for(i=0;i res[i])?i:index;
sum = (sum > res[i])?res[i]:sum;
case '-':res[i]=abs((pa - pb)-9); index = (sum > res[i])?i:index;
sum = (sum > res[i])?res[i]:sum;
case '*':res[i]=abs((pa * pb)-9); index = (sum > res[i])?i:index;
sum = (sum > res[i])?res[i]:sum;
case '/':res[i]=fabs((pa*1.0 / pb)-9); index = (sum > res[i])?i:index;
sum = (sum > res[i])?res[i]:sum;
}
}
printf("%d\n",index+1);
return 0;
}
//刚做完,仅供参考

为什么这道题会WA描述Given N arithmetic expressions,can you tell whose result is closest to 输入Line 1:N (1 为什么这道题会WA描述You are given a sequence of integers,A = a1,a2,...an.A consecutive subsequence of A (say ai,ai+1 ...aj) is called a repeated sequence if it appears more than once in A (there exists some positive k that ai+k = ai,ai+k+1 关于被动语态的题目求解eg.What kind of advice ______ you?A.has gave B.was gave C.had been given to D.has given正确答案为什么不是B呢?eg.The slave _____from morning till night.A.made to work B.was made working C.was made worked D.wa wa ta si wa si a wa se de su 为什么WA<WB? AS'A,WA a given 寻找一首歌,开头歌词是wa wa way,it is a wa wa way. 坐标:A:30°N,150°EB:60°N,30 °WC:0 ° ,90 °WA在C的什麽方向?B在C的什麽方向?为什么说A在C的西北方? aw wa a wa aw a w a w a given 我查了词典大概有这么几个例子..可是为什么我配不到例子里呢given英 ['gɪv(ə)n] 美 ['ɡɪvn] adj.赠予的;沉溺的prep.考虑到v.给予(give的过去分词)eg.that's a given 那是理所当然given 这几题求讲解?1.if i remember (to close) the window,th这几题求讲解?1.if i remember (to close) the window,the thief would not have got in .为什么括号里不能选 to have closed2.i want (to have given ) her a call yesterday.But there wa Given time.he will make a first - class tennis player ,这里为什么用given, Hdu上的一道题1058,一直WA呀,为什么#include#define min(a,b) a Given a positive integer N,you should output the most right digit of N^N. wa ka xi wa ki da o a na da wa ta xi wa a i si li ma si a test was given in America.为什么不用原形?.