一直提示语法错误,求解哪里出错谢谢!
#include<stdio.h>
int main()
{
int n;
int count = 1;
printf("please input a number;");
scanf("%d", &n);
do(
if (n % 2)
(
n = n * 3 + 1;
printf("(%d):%d\n", count++, n);
)
else
(
n /= 2;
printf("(%d):%d\n", count++, n);
)
)while (n != 1);
return 0;
}
严重性 代码 说明 项目 文件 行 禁止显示状态
错误(活动) 应输入表达式 ConsoleApplication2 c:\Users\Administrator\Documents\Visual Studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\源.c 10
错误(活动) 应输入“;” ConsoleApplication2 c:\Users\Administrator\Documents\Visual Studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\源.c 20
错误 C2059 语法错误:“if” ConsoleApplication2 c:\users\administrator\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\源.c 10
错误 C2059 语法错误:“)” ConsoleApplication2 c:\users\administrator\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\源.c 20
错误 C2061 语法错误: 标识符“printf” ConsoleApplication2 c:\users\administrator\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\源.c 13
错误 C2143 语法错误: 缺少“;”(在“)”的前面) ConsoleApplication2 c:\users\administrator\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\源.c 14
错误 C2143 语法错误: 缺少“;”(在“)”的前面) ConsoleApplication2 c:\users\administrator\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\源.c 19