丈夫死亡房产怎么分配:怎么用C++语言编该程序
#include "stdafx.h"
#include "iostream.h"
int main(int argc, char* argv[])
{
char a[20]="kdjfkkmdjk";
char b;
cout<<"ÊäÈëÒ»¸ö×Ö·û£º";
cin>>b;
int k;
k=0;
for(int i=0;i<20;i++)
{
if (a[i]==b)
{
k=1;
cout<<(i+1);
goto l;
}
}
l:
if(k==0)
{
cout<<-1;
}
return 0;
}
#include <iostream.h>
void main()
{char c[13]={'f','s','f','s','y','w','h','l','l','x','q','p','b'};
char pp;
int i,x=14;
cout<<"输入一个字符:";
cin>>pp;
for (i=0;i<=12;i++)
if (pp==c[i])
{x=i;break;}
if (x!=14)
cout<<"字符"<<pp<<"在数组下标为:"<<x<<endl;
else
cout<<"-1"<<endl;
}
#include <iostream.h>
void main()
{char c[14]={'f','s','f','s','y','w','h','l','l','x','q','p','b'};
char pp;
int i,x;
cout<<"输入一个字符:";
cin>>pp;
for (i=0;i<14;i++)
if (pp==c[i])
{x=i;break;}
if (x!=14)
cout<<"字符"<<pp<<"在数组下标为:"<<x<<endl;
else
cout<<"-1"<<endl;
}
CString str;
int i=str.Find("str");