解析 #include "stdafx.h"#include #include using namespace std;int main(){ float a,b,c,x1,x2,d; couta>>b>>c; d=b*b-4*a*c; if(d>=0) { x1=(-b+sqrt(d))/(2*a); x2=(-b+sqrt(d))/(2*a); cout 反馈 收藏
expected primary-expression before "else"#include#includeusing namespace stdint main(){float a,b,c,x1,x2,dcouta>>b>>cd=b*b-4*a*cif(d>=0)x1=(-b+sqrt(d))/(2*a)x2=(-b+sqrt(d))/(2*a)cout 相关知识点: 二次函数 二次函数基础 二次函数的图象性质 二次函数的性质 二次函数的...
你if后面的三个语句要用一对大括号括起来,因为if只管后面一句语句,也就是x=b/100;现在你后面还有2句语句,如果不用大括号括起来的话,相当于if语句已经结束,这时你再加个else,则编译器认为没有合适if语句来匹配else
错误:预期的主要表达之前,“其他” 翻译结果2复制译文编辑译文朗读译文返回顶部 错误:“另外”以前期待最初表达 翻译结果3复制译文编辑译文朗读译文返回顶部 错误: 预期主表达式之前"else" 翻译结果4复制译文编辑译文朗读译文返回顶部 错误:期望的主表达式在“其他人” ...
a尽她最大努力 She greatly diligently[translate] a[Error] C:\Users\DELL\Documents\C-Free\Temp\未命名9.cpp:20: error: expected primary-expression before "else" (错误) C:\Users\DELL\Documents\C -释放\临时雇员\未命名9.cpp :20 : 错误: 期望的主要表示在“之前”[translate]...
Expected primary-expression before "else" That is the error I get in both "else" and "else if". What is wrong in this code.( I searched all around and tried "everything" but found no solution.)123456789101112131415161718 int Answer1,Yes,No,yes,no; cin >>Answer1; if...
error: expected primary-expression before "else"问题补充:匿名 2013-05-23 12:21:38 错误:预期的主要表达之前,“其他” 匿名 2013-05-23 12:23:18 错误:期望的主表达式在“其他人” 匿名 2013-05-23 12:24:58 错误: 期望的主要表示在“之前” 匿名 2013-05-23 12:26:38 错误: 预期主...
if(s[0]==s[len-1]);这里加多了一个分号 要采纳哦 !~~
Expected Primary-expressionApr 29, 2008 at 12:04pm Danny329 (2) I've been looking through this code for 2 hours, been on google. But i still can't fing the answer to this:expected primary-expression before "else" The problem is in part of the if and else-if section but I don'...
{ printf("请输入待解密文件\n");scanf("%c",&e);f=e^9;printf("解密完成\n%c",f);} else printf("对不起,你没有访问权限");if else这些中的语句最好都加上大括号 不然就很容易出现这种问题 你现在运行看看 建议你都加上 程序都分开 不然你的if都不知道对应那个else 计算机并不算人...