Results 1 to 6 of 6
Thread: C++ ?
Hybrid View
-
14th January 2010 23:00 #1
C++ ?
, . .
:
Code:#include <iostream> #include <string> #include <cctype> using namespace std; void showValues(string, int); long int main() { string sentence; cout << "Enter text: "; getline(cin, sentence); showValues(sentence, sentence.length()); system("pause"); return 0; } void showValues (string chars, int size) { int y=0; for (int i=0;i<size;i++) { int temp=(int)chars[i]; if ((temp>64 && temp<91) || (temp>96 && temp<123) || (temp>1040 && temp<1103)) y++; } cout << y << " Letters" << endl; cout << endl; }
. 3-4 , . .
2.
Last edited by ABDON; 14th January 2010 at 23:48.
Toys: ThinkPad T510 | iPhone 4 | Ultimate Ears Super.fi 4vi | X-mini II
www.ivanzhelev.com
-
15th January 2010 00:10 #2
Win32 :
IsCharAlpha
, . , , IsCharAlphaW.EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
15th January 2010 12:55 #3Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
? , 866.
Unicode, ?
-
15th January 2010 14:27 #4, -. string , . sizeof(chars[i]) e . .Code:
#include <iostream> #include <string> #include <cctype> #include <windows.h> using namespace std; void showValues(string, int); long int main() { string sentence; cout << "Current code page:" << GetConsoleCP()<<endl; cout << "Enter text: "; getline(cin, sentence); showValues(sentence, sentence.length()); system("pause"); return 0; } void showValues (string chars, int size){ int y=0; for (int i=0;i<size;i++){ if (IsCharAlpha(chars[i])) y++; } cout << y << " Letters" << endl; cout << endl; }EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
15th January 2010 15:39 #5
-
15th January 2010 15:53 #6
, , 1251. GetConsoleCP. , , string, STL(?), C++ .
C++ -, .
, IsCharAlpha , , , , .
, , , - , , (). , - ANSI .
, IsCharAlpha .EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in