| 
 | 
 
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册  
 
x
 
#include "stdafx.h" 
#include<iostream> 
using namespace std; 
class count { 
private: 
        char str[100]; 
public: 
        count(char s[]) { 
                strcpy(str, s); 
        } 
        void computer(); 
}; 
void count::computer() { 
        int Letters = 0; 
        int Digital = 0; 
        int Space = 0; 
        int Other = 0; 
        int i = 0; 
        while (str[i]){ 
 
                if (str[i] >= 'A' && str[i] <= 'Z' || str[i] >= 'a' && str[i] <= 'z') { 
                        Letters++; 
                } 
                else if (str[i] >= '0' && str[i] <= '9') { 
                        Digital++; 
                } 
                else if (str[i] == ' ') { 
                        Space++; 
                } 
                else { 
                        Other++; 
                } 
                i++; 
        } 
         
} 
int main() 
{ 
        char s[100]; 
        s[100] = getchar(); 
        count A(s); 
        A.computer(); 
 
        system("pause"); 
 
    return 0; 
} 
 
这个调用显示错误:"count"不明确。 
希望大佬们能指点指点   |   
 
 
 
 |