1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
// NTS.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
#include <iostream>
#include <conio.h>
#include <algorithm>
#include <string>
using namespace NTS;
using namespace std;
int acount;
int bcount;
int ccount;
int dcount;
int ecount;
int fcount;
int gcount;
int hcount;
int icount;
int jcount;
int kcount;
int lcount;
int mcount;
int ncount;
int ocount;
int pcount;
int qcount;
int rcount;
int scount;
int tcount;
int ucount;
int vcount;
int wcount;
int xcount;
int ycount;
int zcount;
int sphere1 = 1;
int sphere2 = 2;
int sphere3 = 3;
int sphere4 = 4;
int sphere5 = 5;
int sphere6 = 6;
int sphere7 = 7;
int sphere8 = 8;
int sphere9 = 9;
int sphere0 = 10;
int count1;
int count2;
int count3;
int count4;
int count5;
int count6;
int count7;
int count8;
int count9;
int count0;
int rsphere1;
int rsphere2;
int rsphere3;
int rsphere4;
int rsphere5;
int rsphere6;
int rsphere7;
int rsphere8;
int rsphere9;
int rsphere0;
int CountCharacter( char * str , char ch )
{
int countChar = 0;
for ( int i = 0; str[i] != '\0'; i++)
{
if ( str[i] == ch )
countChar = countChar + 1;
}
return countChar;
}
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
char str[4095] = "";
acount = CountCharacter( str , 'A' );
bcount = CountCharacter( str , 'B' );
ccount = CountCharacter( str , 'C' );
dcount = CountCharacter( str , 'D' );
ecount = CountCharacter( str , 'E' );
fcount = CountCharacter( str , 'F' );
gcount = CountCharacter( str , 'G' );
hcount = CountCharacter( str , 'H' );
icount = CountCharacter( str , 'I' );
jcount = CountCharacter( str , 'J' );
kcount = CountCharacter( str , 'K' );
lcount = CountCharacter( str , 'L' );
mcount = CountCharacter( str , 'M' );
ncount = CountCharacter( str , 'N' );
ocount = CountCharacter( str , 'O' );
pcount = CountCharacter( str , 'P' );
qcount = CountCharacter( str , 'Q' );
rcount = CountCharacter( str , 'R' );
scount = CountCharacter( str , 'S' );
tcount = CountCharacter( str , 'T' );
ucount = CountCharacter( str , 'U' );
vcount = CountCharacter( str , 'V' );
wcount = CountCharacter( str , 'W' );
xcount = CountCharacter( str , 'X' );
ycount = CountCharacter( str , 'Y' );
zcount = CountCharacter( str , 'Z' );
_getche();
count1 = acount + icount + jcount + kcount + qcount + tcount + ycount;
count2 = bcount + kcount + lcount + rcount + ucount;
count3 = ccount + gcount + lcount + mcount + scount + xcount;
count4 = dcount + mcount + ncount + tcount + ycount;
count5 = ecount + hcount + ncount + ocount + xcount;
count6 = fcount + jcount + pcount + ucount + vcount + wcount;
count7 = gcount + ocount + qcount + vcount + zcount;
count8 = fcount + hcount + pcount + rcount;
count9 = icount + scount;
count0 = jcount + kcount + lcount + mcount + ncount + ocount + pcount + qcount + rcount + scount + tcount + ucount + vcount + wcount + xcount + ycount;
rsphere1 = sphere1 * count1;
rsphere2 = sphere2 * count2;
rsphere3 = sphere3 * count3;
rsphere4 = sphere4 * count4;
rsphere5 = sphere5 * count6;
rsphere6 = sphere6 * count6;
rsphere7 = sphere7 * count7;
rsphere8 = sphere8 * count8;
rsphere9 = sphere9 * count9;
rsphere0 = sphere0 * count0;
return 0;
}
| |