GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — leetcode/countCode.cpp at master · Fect/leetcode Expand file tree/ Copy pathcountCode.cppMore file actions 24 lines (22 loc) · 506 Bytes / Copy pathcountCode.cppFile metadata and controls24 lines (22 loc) · 506 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include<bits/stdc++.h> using namespace std; void countCode(string str){ int engletter = 0; int kg = 0; int other = 0; for(int i=0;i<str.size();i++){ if((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z')){ engletter++; }else if(str[i]==' '){ kg++; }else{ other++; } } cout<<engletter<<" "<<kg<<" "<<other<<endl; } int main(){ string str = "z hln89@$%$ adkfj=1"; countCode(str); system("pause"); } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |