15,881,898 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 How to built FAT mounter in c++ AtifKahn6-Jul-10 18:33 AtifKahn 6-Jul-10 18:33
 Re: How to built FAT mounter in c++ Richard MacCutchan6-Jul-10 21:30 Richard MacCutchan 6-Jul-10 21:30
 Re: How to built FAT mounter in c++ AtifKahn8-Jul-10 18:31 AtifKahn 8-Jul-10 18:31
 Re: How to built FAT mounter in c++ Richard MacCutchan9-Jul-10 21:26 Richard MacCutchan 9-Jul-10 21:26
 Removing white space T.RATHA KRISHNAN6-Jul-10 18:23 T.RATHA KRISHNAN 6-Jul-10 18:23
 Re: Removing white space «_Superman_»6-Jul-10 20:18 «_Superman_» 6-Jul-10 20:18
 Re: Removing white space Richard MacCutchan6-Jul-10 21:32 Richard MacCutchan 6-Jul-10 21:32
 find a effictive way!! wbgxx6-Jul-10 17:46 wbgxx 6-Jul-10 17:46
 for example there is a four bits integer 1122, if someone guess and inout 1234, because 1 and 2 are in 1122, and the position is same, the computer will tell you that you are right with two numbers and they are 1 and 2; as follows is my program, I thinnk they are too complex , could some tell me a simple algorithm, thinks in advantage ```#include
#include

int main()
{
int data1 = 1234;
int data2;
int gewei1, shiwei1, baiwei1, qianwei1;
int gewei2, shiwei2, baiwei2, qianwei2;
int count = 0;

gewei1 = data1%10;
shiwei1 = (data1%100)/10;
baiwei1 = (data1%1000)/100;
qianwei1 = data1 /1000;

int arr1[4] = {qianwei1, baiwei1, shiwei1, gewei1};

scanf("%d", &data2);

gewei2 = data2%10;
shiwei2 = (data2%100)/10;
baiwei2 = (data2%1000)/100;
qianwei2 = data2 /1000;
int arr2[4] = {qianwei2, baiwei2, shiwei2, gewei2};

for (int i=0; i<4; i++)
{
if(arr1[i] == arr2[i])
{
printf("%d ", arr1[i]);
count++;
}
else
continue;
}
printf("the same number is %d ", count);
return 0;
}```
 Re: find a effictive way!! CPallini6-Jul-10 20:48 CPallini 6-Jul-10 20:48
 Re: find a effictive way!! Richard MacCutchan6-Jul-10 21:35 Richard MacCutchan 6-Jul-10 21:35
 Re: find a effictive way!! wbgxx6-Jul-10 21:56 wbgxx 6-Jul-10 21:56
 Re: find a effictive way!! Richard MacCutchan7-Jul-10 2:48 Richard MacCutchan 7-Jul-10 2:48
 IME Ed SHaw6-Jul-10 13:46 Ed SHaw 6-Jul-10 13:46
 c++ code to solve M simultanous linear equations with N variables - N
 Re: c++ code to solve M simultanous linear equations with N variables - N
 Re: c++ code to solve M simultanous linear equations with N variables - N
 MFC debug version mfc90d.dll issue kasi146-Jul-10 8:35 kasi14 6-Jul-10 8:35
 Re: MFC debug version mfc90d.dll issue Maximilien6-Jul-10 10:22 Maximilien 6-Jul-10 10:22
 Re: MFC debug version mfc90d.dll issue kasi146-Jul-10 13:00 kasi14 6-Jul-10 13:00
 can not see progress in the progress Bar mrby1236-Jul-10 7:51 mrby123 6-Jul-10 7:51
 Re: can not see progress in the progress Bar David Crow6-Jul-10 7:54 David Crow 6-Jul-10 7:54
 Re: can not see progress in the progress Bar mrby1236-Jul-10 8:19 mrby123 6-Jul-10 8:19
 Re: can not see progress in the progress Bar Cedric Moonen6-Jul-10 9:54 Cedric Moonen 6-Jul-10 9:54
 How to build 64bit SDI with MFC? [modified] hztj20056-Jul-10 7:24 hztj2005 6-Jul-10 7:24
 Re: How to build 64bit SDI with MFC? David Crow6-Jul-10 7:52 David Crow 6-Jul-10 7:52
 Last Visit: 31-Dec-99 18:00     Last Update: 19-Apr-24 16:15 Refresh ᐊ Prev1...1739174017411742174317441745174617471748 Next ᐅ