Example #1
0
void main(void) {
  char cadena[MAXTAM];
  
  introduce(cadena);
  inic(cadena);
  fin(cadena);
  inter(cadena);
  puts(cadena);
  
  printf("\nLA CADENA TIENE %d PALABRAS", contar(cadena));
}
Example #2
0
int main ()
{
    char ch;
    no = si = 0x00;
    do {
        libera_lista();
        ch = menu();
        switch(ch) {
            case 'i': introduce();
                break;
            case 'p': pregunta();
                break;
            case 's': salva();
                break;
            case 'c': carga();
                break;
        }
    } while (ch != 'x');
    return (0);
}
//--------------------------------------------------------------
void testApp::setup(){
    
    Person p;
    p.age = 8;
    p.alive = true;
    p.employed = false;
    p.name = "some kid";
    p.major = "mfadt";
    
    Person q;
    q.name = "other name";
    q.age = 9102;
    q.alive = false;
    
    cout << "There's this kid named" << p.name << "!" << endl;
    
    introduce (p, q);
    p.meet(q);
    
}
Example #4
0
void select()
{
    ofstream Cout;
    Cout.open("out.txt", ostream::app);
    ifstream cin;
    cin.open("input");
    string Select;
    welcome();
    introduce();
    while (cin >> Select)
    {
        Cout << Select << endl;
        system("cls");
        if (Select == "i")
        {
            Funtion_introduce();
            cout << "请输入1-13进行选择,输入\"q\"退出" << endl;
            Cout << "请输入1-13进行选择,输入\"q\"退出" << endl;
            string select;
            while (cin >> select)
            {
                Cout << select << endl;
                if (select == "1")
                {
                    string name_Root;
                    cout << "输入祖先的名字" << endl;
                    Cout << "输入祖先的名字" << endl;
                    cin >> name_Root;

                    set_root(name_Root);
                }
                else if (select == "2")
                {
                    string name_husband;
                    string name_wife;
                    cout << "输入老公和老婆的名字" << endl;
                    Cout << "输入老公和老婆的名字" << endl;
                    cin >> name_husband >> name_wife;

                    add_wife(name_husband, name_wife);
                }
main()
{
imprimegato();
char t='X';
char posicion;

 while(bandera==true)
 {
   cout<<"Es el turno de "<<t<<" introduzca posicion: ";
   cin>>posicion;
   posicion=toupper(posicion);
   introduce(t,posicion);

  // comprueba(turno);
evalua(t);
cambiaturno(t);
   imprimegato();
  }

system("pause");
}//fin main
Example #6
0
//--------------------------------------------------------------
void testApp::setup(){
    Person p;
    p.age = 8;
    p.alive = true;
    p.employed = false;
    p.name = "some kid";
    p.major = "mfadt";


    cout << "There's this kid named " << p.name << "!" <<  endl;

    Person q;

    q.name = "other name";
    q.age = 90210;

    introduce(&p, &q);


    p.meet(q);
    p.switchMajor("liberal arts");
}
Example #7
0
        introduce_dialog::introduce_dialog(
                const std::string& title, 
                us::user_service_ptr s, 
                QWidget* parent) : 
            QDialog{parent},
            _user_service{s}
        {
            REQUIRE(s);

            auto* layout = new QVBoxLayout{this};
            setLayout(layout);

            _contact_1 = new contact_select_widget{s};
            _contact_2 = new contact_select_widget{s};
            _message_1 = new QLineEdit;
            _message_2 = new QLineEdit;
            _message_label_1 = new QLabel;
            _message_label_2 = new QLabel;
            _introduce = new QPushButton;
            make_introduce(*_introduce);
            _introduce->setToolTip(tr("Introduce"));
            _introduce->setEnabled(false);

            _cancel = new QPushButton;
            _cancel->setToolTip(tr("Cancel"));
            make_cancel(*_cancel);

            auto lw = new QWidget;
            auto ll = new QVBoxLayout{lw};

            ll->addWidget(new QLabel{tr("introduce")});
            ll->addWidget(_contact_1);
            ll->addWidget(_message_label_1);
            ll->addWidget(_message_1);

            auto rw = new QWidget;
            auto rl = new QVBoxLayout{rw};

            rl->addWidget(new QLabel{tr("to")});
            rl->addWidget(_contact_2);
            rl->addWidget(_message_label_2);
            rl->addWidget(_message_2);

            auto hw = new QWidget;
            auto hl = new QHBoxLayout{hw};
            hl->addWidget(lw);
            hl->addWidget(rw);

            layout->addWidget(hw);

            auto bw = new QWidget;
            auto bl = new QHBoxLayout{bw};
            bl->addWidget(_cancel);
            bl->addWidget(_introduce);

            layout->addWidget(bw);

            connect(_contact_1, SIGNAL(activated(int)), this, SLOT(contact_1_selected(int)));
            connect(_contact_2, SIGNAL(activated(int)), this, SLOT(contact_2_selected(int)));
            connect(_introduce, SIGNAL(clicked()), this, SLOT(introduce()));
            connect(_cancel, SIGNAL(clicked()), this, SLOT(cancel()));

            setWindowTitle(tr(title.c_str()));

            update_widgets();

            INVARIANT(_user_service);
            INVARIANT(_contact_1);
            INVARIANT(_contact_2);
            INVARIANT(_message_1);
            INVARIANT(_message_2);
            INVARIANT(_introduce);
            INVARIANT(_cancel);
        }
Example #8
0
int main()
{
	int i, j;
	char k;
	for (i = 0; i <= n; i++)
	{
		for (j = 0; j <= n; j++)
		{
			cost[i][j] = INT_MAX;
		}
		
	}
	cost[1][2] = cost[2][1] = 12;
	cost[1][3] = cost[3][1] = 24;
	cost[3][4] = cost[4][3] = 21;
	cost[2][4] = cost[4][2] = 16;
	cost[2][10] = cost[10][2] = 29;
	cost[3][5] = cost[5][3] = 30;
	cost[5][6] = cost[6][5] = 16;
	cost[6][7] = cost[7][6] = 27;
	cost[10][9] = cost[9][10] = 46;
	cost[4][10] = cost[10][4] = 5;
	cost[4][7] = cost[7][4] = 12;
	cost[7][8] = cost[8][7] = 36;
	cost[8][9] = cost[9][8] = 22;
	cost[1][1] = cost[2][2] = cost[3][3] = cost[4][4] = cost[5][5] = cost[6][6] = cost[7][7] = cost[8][8] = cost[9][9] = cost[10][10] = 0;

	while (1)
	{
		printf("-----------------------------------\n");
		printf("\t学校地点列表:\n");
		printf("\t1:西门  \t2:教学楼\n");
		printf("\t3:工科楼  \t4:未央操场\n");
		printf("\t5:图书馆  \t6:篮球场\n");
		printf("\t7:田径场  \t8:室内球馆\n");
		printf("\t9:饭堂  \t10:宿舍楼\n");
		printf("-----------------------------------\n\n");



		printf("\t-----欢迎使用!-----\n\n");
		printf("\ta.信息查询\n");
		printf("\tb.最短路径\n");
		printf("\tc.退出\n\n");
		printf("\t请选择:");
		scanf("\n%c", &k);



		switch (k)
		{
		case 'a':
			printf("");
			introduce();

			printf("按Entre键继续");
			getchar();
			system("cls");
			break;
		case 'b':
			printf("");
			shortestdistance();
			printf("按Entre键继续");
			getchar();
			getchar();
			system("cls");
			break;
		case 'c':
			printf("谢谢使用");
			exit(0);
		default:
			printf("\t输入信息有误!请重新输入。\n");
			getchar();
			getchar();
			system("cls");
			break;
		}

	}
}