我想编译和TURBOC运行此++,我正则表达式语法错误在行 否则,如果(文[I] ==”“))表达式语法错误TURBOC++
我也试图在代码块只有很小的改动,但它返回“counting - Debug”使用了一个无效的编译器。编译器选项中的工具链路径可能没有正确设置?跳过... 没有事可做。
反正我的主要目的是使其在TURBOC++
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
void main()
{
clrscr();
int nu,nl,nd,nb,ns;
char text[100];
nu=nl=nd=nb=ns=0;
cout<<"enter a line of text\n";
cin>>text;
for(int i=0;text[i]!='\0';i++)
{
if(isupper(text[i]))
nu++;
else if(islower(text[i]))
nl++;
else if(isdigit(text[i]))
nd++;
else if(text[i]==' '))
nb++;
else
ns++;
cout<<"total number of uppercase alphabets="<< nu << ".\n";
cout<<"total number of lowercase alphabets="<< nl << ".\n";
cout<<"total number of digits="<< nd << ".\n";
cout<<"total number of blank spaces="<< nb << ".\n";
cout<<"total number of other symbols="<< ns << ".\n";
getch();
}
有太多了) – deviantfan
我会推荐刷新如何格式化你的代码,它也将有助于你使用一个IDE,将轻松地匹配打开/关闭括号/ parens /等。 – admdrew
雅是一个愚蠢的错误,但为什么我得到的答案错误时,我输入文字的数字和字母... – neonano