void print (void) { int was_c; extern asHotKey hotkeys[]; was_c = help_context; help_context = CONTEXT_PRINT; hotkeys[1].able=0; hotkeys[2].able=0; hotkeys[3].able=0; hotkeys[4].able=0; hotkeys[5].able=0; hotkeys[6].able=0; hotkeys[7].able=0; hotkeys[8].able=0; #ifdef ENGLISH submenu (" Print ",(int)XBUTTONSIZE*3,0,mnPrint); #else submenu (" Принтер ",(int)XBUTTONSIZE*3,0,mnPrint); #endif hotkeys[1].able=1; hotkeys[2].able=1; hotkeys[3].able=1; hotkeys[4].able=1; hotkeys[5].able=1; hotkeys[6].able=1; hotkeys[7].able=1; hotkeys[8].able=1; help_context = was_c; }
void quality (void) /* установка длины печати, мл байт mode */ { int j,was_c; was_c = help_context; help_context = CONTEXT_QUALITY; #ifdef ENGLISH j=submenu (" Length ",(int)XBUTTONSIZE*3,YSPACE+YBUTTONSIZE,mnQual); #else j=submenu (" Длина ",(int)XBUTTONSIZE*3,YSPACE+YBUTTONSIZE,mnQual); #endif mode=mode&0xf00; switch(j) {case 0: mode+=0; break; case 1: mode+=5; break; case 2: mode+=4; break; case 3: mode+=6; break; case 4: mode+=1; break; case 5: mode+=2; break; case 6: mode+=3; break; case 7: mode+=32; break; case 8: mode+=38; break; case 9: mode+=33; break; case 10: mode+=39; break; case 11: mode+=40; break; default: mode+=1; } help_context = was_c; }
void height (void) /* установка высоты печати 0-single, 1-double */ { /* код в ст. байте mode */ int j,was_c; was_c = help_context; help_context = CONTEXT_HEIGHT; #ifdef ENGLISH j=submenu (" Height ",(int)XBUTTONSIZE*4,YSPACE+YBUTTONSIZE*2,mnHeig); #else j=submenu (" Высота ",(int)XBUTTONSIZE*4,YSPACE+YBUTTONSIZE*2,mnHeig); #endif if(j>=0) mode=(mode&0xff)+(j<<8); help_context = was_c; }
void setport (void) { int j,was_c; was_c = help_context; help_context = CONTEXT_PORT; #ifdef ENGLISH j=submenu (" Output to: ",(int)XBUTTONSIZE*4,YSPACE+YBUTTONSIZE*3,mnPort); #else j=submenu (" Вывод на: ",(int)XBUTTONSIZE*4,YSPACE+YBUTTONSIZE*3,mnPort); #endif if (j>-1) port=j; help_context = was_c; }
void tst_QMenu::mouseActivation() { #ifdef Q_OS_WINCE_WM QSKIP("We have a separate mouseActivation test for Windows mobile.", SkipAll); #endif QMenu menu; menu.addAction("Menu Action"); menu.show(); QTest::mouseClick(&menu, Qt::LeftButton, 0, QPoint(5, 5), 300); QVERIFY(!menu.isVisible()); //context menus can allways be accessed with right click except on windows menu.show(); QTest::mouseClick(&menu, Qt::RightButton, 0, QPoint(5, 5), 300); QVERIFY(!menu.isVisible()); #ifdef Q_OS_WIN //on windows normal mainwindow menus Can only be accessed with left mouse button QMenuBar menubar; QMenu submenu("Menu"); submenu.addAction("action"); QAction *action = menubar.addMenu(&submenu); menubar.show(); QTest::mouseClick(&menubar, Qt::LeftButton, 0, menubar.actionGeometry(action).center(), 300); QVERIFY(submenu.isVisible()); QTest::mouseClick(&submenu, Qt::LeftButton, 0, QPoint(5, 5), 300); QVERIFY(!submenu.isVisible()); QTest::mouseClick(&menubar, Qt::LeftButton, 0, menubar.actionGeometry(action).center(), 300); QVERIFY(submenu.isVisible()); QTest::mouseClick(&submenu, Qt::RightButton, 0, QPoint(5, 5), 300); QVERIFY(submenu.isVisible()); #endif }
void main() { int datos[100];//datos es el arreglo de 100 elementos de 0 a 99 int n;//n es el numero de elementos con los que trabajamos char sn; do { menu(); scanf("%c", &sn); switch(sn) { case '1': ingresar(&n, datos); break; case '2': submenu(n, datos); break; case 'S': sn = 's'; }//switch(sn) }while(sn != 's'); }//void main()
void tst_QMenu::mouseActivation() { QWidget topLevel; QMenu menu(&topLevel); topLevel.show(); menu.addAction("Menu Action"); menu.show(); QTest::mouseClick(&menu, Qt::LeftButton, 0, menu.rect().center(), 300); QVERIFY(!menu.isVisible()); //context menus can always be accessed with right click except on windows menu.show(); QTest::mouseClick(&menu, Qt::RightButton, 0, menu.rect().center(), 300); QVERIFY(!menu.isVisible()); #ifdef Q_OS_WIN //on windows normal mainwindow menus Can only be accessed with left mouse button QMenuBar menubar; QMenu submenu("Menu"); submenu.addAction("action"); QAction *action = menubar.addMenu(&submenu); menubar.show(); QTest::mouseClick(&menubar, Qt::LeftButton, 0, menubar.actionGeometry(action).center(), 300); QVERIFY(submenu.isVisible()); QTest::mouseClick(&submenu, Qt::LeftButton, 0, QPoint(5, 5), 300); QVERIFY(!submenu.isVisible()); QTest::mouseClick(&menubar, Qt::LeftButton, 0, menubar.actionGeometry(action).center(), 300); QVERIFY(submenu.isVisible()); QTest::mouseClick(&submenu, Qt::RightButton, 0, QPoint(5, 5), 300); QVERIFY(submenu.isVisible()); #endif }
void GraphicsView::contextMenuEvent(QContextMenuEvent* event) { bool someItemIsUnderCursor = false; for (auto item : scene()->items()) { if (item->isUnderMouse()) { someItemIsUnderCursor = true; break; } } if (!someItemIsUnderCursor) { QMenu menu(this), submenu(QStringLiteral("Добавить элемент..."), &menu); submenu.addAction(QStringLiteral("Вершинный шейдер")); submenu.addAction(QStringLiteral("Пиксельный шейдер")); submenu.addAction(QStringLiteral("Геометрический шейдер")); submenu.addAction(QStringLiteral("Шейдер поверхности")); submenu.addAction(QStringLiteral("Вычислительный шейдер")); submenu.addAction(QStringLiteral("Доменный шейдер")); menu.addMenu(&submenu); connect(&menu, SIGNAL(triggered(QAction*)), SLOT(onContextMenu(QAction*))); menu.exec(event->globalPos()); event->accept(); }
int main(){ int choice0, choice1; BOOK *head = nullptr; do{ choice0 = menu(); switch (choice0){//start of menu case 0:{ break; } case 1:{//Load data from file head = input();//input() returns the head of the list break; } case 2:{ choice1 = submenu(head);//choice1 is to get the return of submenu break; } default:{ cout << "Error when you choose the number."; break; } } } while (choice0 != 0); //end of menu //prompt_wait(); return 0; }
void DropDownList::onLeftUp(wxMouseEvent&) { if (mouse_down) { if (selected_item != NO_SELECTION && !itemEnabled(selected_item)) return; // disabled item // don't hide if there is a child menu if (selected_item != NO_SELECTION && submenu(selected_item)) return; hide(true); } }
bool DropDownList::showSubMenu(size_t item, int y) { DropDownList* sub_menu = item == NO_SELECTION ? nullptr : submenu(item); if (sub_menu == open_sub_menu) return sub_menu; // no change hideSubMenu(); open_sub_menu = sub_menu; if (!sub_menu) return false; // open new menu wxSize size = GetSize(); sub_menu->show(true, sub_menu->GetParent()->ScreenToClient(ClientToScreen( wxPoint(size.GetWidth() - 1, y + (int)item_size.height) ))); return true; }
void remote() { int error=TRUE, choice=1, ask=FALSE; char buf[MAXLEN]; int ret; while(TRUE) { if(error) { while((ret = init_mainmenu())==0); if(ret==1) error = FALSE; else return; } while (!error) { while((ret=waitfor("*EAAI", 1, TIMEOUT))==0) check_msg(); if(ret==-1) error=TRUE; else ask=TRUE; while(ask && !error) { buf[0]=0; choice = submenu(choice); switch(choice) { case -1: error=TRUE; ask=FALSE; choice=1; break; case 0: ask=FALSE; choice=1; break; default: ask=TRUE; exec_menu(conf->menu[choice-1]); break; } } } } }
int main () { int opc=-1; int opc2=-1; do { system ("cls"); menu_principal (); scanf ("%d", &opc); switch (opc){ case 1:{ system ("cls"); submenu (); scanf ("%d", &opc2); switch (opc2){ case 1:{ fun1 (); getch (); limpiar_tablero (Tablero); break; } case 2:{ fun2 (); getch (); limpiar_tablero (Tablero); break; } case 0:{ system ("cls"); opc=-1; break; } } break; } case 0:{ break; } } }while (opc !=0); //getch (); }
void DropDownList::drawItem(DC& dc, int y, size_t item) { if (y + item_size.height <= 0 || y >= dc.GetSize().y) return; // not visible // draw background dc.SetPen(*wxTRANSPARENT_PEN); if (item == selected_item) { if (itemEnabled(item)) { dc.SetBrush (wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); } else { dc.SetBrush (wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); } dc.DrawRectangle(marginW, y, (int)item_size.width, (int)item_size.height); } else if (!itemEnabled(item)) { // mix between foreground and background dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); } else if (highlightItem(item)) { // mix a color between selection and window dc.SetBrush (lerp(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), 0.75)); dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); dc.DrawRectangle(marginW, y, (int)item_size.width, (int)item_size.height); } else { dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); } // draw text and icon drawIcon(dc, marginW, y, item, item == selected_item); dc.DrawText(capitalize(itemText(item)), marginW + (int)icon_size.width + 1, y + text_offset); // draw popup icon if (submenu(item)) { draw_menu_arrow(this, dc, RealRect(marginW, y, item_size.width, item_size.height), item == selected_item); } // draw line below if (lineBelow(item) && item != itemCount()) { dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); dc.DrawLine(marginW, y + (int)item_size.height, marginW + (int)item_size.width, y + (int)item_size.height); } }
Gobby::MenuManager::MenuManager(GtkSourceLanguageManager* language_manager) { Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_resource( "/de/0x539/gobby/ui/menu.ui"); m_app_menu = Glib::RefPtr<Gio::Menu>::cast_dynamic( builder->get_object("appmenu")); m_menu = Glib::RefPtr<Gio::Menu>::cast_dynamic( builder->get_object("winmenu")); Glib::RefPtr<Gio::Menu> highlight_mode_menu = get_highlight_mode_menu(); const gchar* const* language_ids = gtk_source_language_manager_get_language_ids( language_manager); if(language_ids != NULL) { typedef std::list<GtkSourceLanguage*> LanguageList; typedef std::map<std::string, LanguageList> LanguageMap; LanguageMap languages; for(const gchar* const* id = language_ids; *id != NULL; ++id) { GtkSourceLanguage* language = gtk_source_language_manager_get_language( language_manager, *id); if(gtk_source_language_get_hidden(language)) continue; const std::string section = gtk_source_language_get_section(language); languages[section].push_back(language); } for(LanguageMap::iterator iter = languages.begin(); iter != languages.end(); ++iter) { Glib::RefPtr<Gio::Menu> submenu(Gio::Menu::create()); LanguageList& list = iter->second; list.sort(language_sort_func); for(LanguageList::const_iterator liter = list.begin(); liter != list.end(); ++liter) { GtkSourceLanguage* language = *liter; const std::string id = gtk_source_language_get_id(language); const std::string name = gtk_source_language_get_name(language); Glib::RefPtr<Gio::MenuItem> item( Gio::MenuItem::create( name, Glib::ustring::compose( "win.highlight-mode" "('%1')", id))); submenu->append_item(item); } highlight_mode_menu->append_submenu( iter->first, submenu); } } }
//CODIGO PARA APARENTAR MOVIENTO void muevesubmenu() { int i; char tecla; i=1; submenu(); do{ //(IMPORTANTE) validar los cambios de color de las cajas switch(i) { case 1: box(10,40,110,60,1,4); outtextxy(40,45,"Batalla 1"); break; case 2: box(10,60,110,80,1,4); outtextxy(40,65,"Batalla 2"); break; case 3: box(10,80,110,100,1,4); outtextxy(40,85,"Batalla 3"); break; case 4: box(10,100,110,120,1,4); outtextxy(40,105,"Batalla 4"); break; case 5: box(10,120,110,140,1,4); outtextxy(40,125,"Batalla 5"); break; }//FINDARK tecla=getch(); switch(i) { case 1: box(10,40,110,60,1,7); outtextxy(40,45,"Batalla 1"); break; case 2: box(10,60,110,80,1,7); outtextxy(40,65,"Batalla 2"); break; case 3: box(10,80,110,100,1,7); outtextxy(40,85,"Batalla 3"); break; case 4: box(10,100,110,120,1,7); outtextxy(40,105,"Batalla 4"); break; case 5: box(10,120,110,140,1,7); outtextxy(40,125,"Batalla 5"); break; }//FINDLIGHT //Para validar los movimientos izquierda,derecha switch(tecla) {case 0: tecla=getch(); switch(tecla) {case 72: i--;break; case 80: i++;break; } if(i>5)i=1; if(i<1)i=5; break;//fin cero //validar las pantalla case 13: switch(i) { case 1: jugando();break; case 2: jugando();break; case 3: jugando();break; case 4: jugando();break; case 5: jugando ();break; } //para recuerperar menu(pintar menu) if(i!=6)submenu(); break;//fin enter } }while(tecla!=27); }
void main() { avl *T,*q,*p,*avail,*pp,*pivote; char opcion,opcion1,inf; unsigned int sw=0,SW=0; do{ menu (); do{ opcion=getchar(); }while(opcion<'0' && opcion>'5'); switch (opcion){ case '1': if (sw==0){ T=0; sw=1; SW=1; avail=0; clrscr(); gotoxy(31,12); printf("ARBOL INICIALIZADO"); validar(); } else{ clrscr(); gotoxy(24,12); printf("ARBOL YA CREADO "); validar(); } break; case '2': if (sw==0){ control_sw(); } else{ clrscr(); gotoxy(24,12); printf("DIGITE LA INFORMACION = "); gotoxy(47,12); lea_info(&inf); // validar(); SW=0; construiarbol(&T,inf); //inser_avl(&T,inf); //crear_arbol_busqueda(&T,inf); } break; case '3': if (sw==0){ control_sw(); } else{ if(SW==0){ do{ submenu(); do{ opcion1=getchar(); }while (opcion1<'0' && opcion1>'4'); switch(opcion1){ case '1': clrscr(); gotoxy(20,2); printf("RECORRIDO DE UN ARBOL EN PREORDEN"); gotoxy(20,8); preorden(T); validar(); break; case '2': clrscr(); gotoxy(23,2); printf("RECORRIDO DE UN ARBOL EN POSTORDEN"); gotoxy(20,8); postorden(T); validar(); break; case '3': clrscr(); gotoxy(24,2); printf("RECORRIDO DE UN ARBOL EN INORDEN"); gotoxy(23.5,8); inorden(T); validar(); break; default:break; } }while(opcion1!='4'); } else{ control_sw1(); } } break; case '4':if(sw==0){ control_sw(); } else{ if(SW==0){ clrscr(); gotoxy(24,12); printf("DIGITE LA INFORMACION A CANCELAR = "); lea_info(&inf); clrscr(); remover_nodo_del_arbol_avl(&T,inf,avail,&SW); preorden_avl(T); } else{ control_sw1(); } } break; default:break; } }while(opcion!= '5'); clrscr(); T=0; gotoxy(30,12); printf("FIN DE PROCESO"); }
int main() { char opcao; char *opcoes_menu[]={ "1. Devolver Livro", "2. Requisitar Livro", "3. Cancelar Reserva", "4. Listar Livros com Entrega em Atraso", "5. Informacoes", "0. Sair", NULL }; Livro livros; Utente utentes; Requisit requisit; livros = cria_lista_l(); utentes = cria_lista_u(); requisit = cria_lista_r(); constroi(livros,utentes,requisit); clear(); boneco(1); pause(); while((opcao=menu(opcoes_menu))!=SAIR) switch (opcao) { case DEVOLVER: { clear(); devolver(requisit,livros,utentes); pause(); break; } case REQUISITAR: { clear(); requisitar(livros,utentes,requisit); pause(); break; } case CANCELAR: { clear(); cancelar_reserva(requisit,livros,utentes); pause(); break; } case LISTAR: { clear(); livros_atraso(requisit,livros,utentes); pause(); break; } case INFO: { clear(); submenu(requisit,livros,utentes); break; } } destroi_lista_l(livros); destroi_lista_u(utentes); destroi_lista_r(requisit); clear(); boneco(2); pause(); return 0; }
TestMRPPWindow::TestMRPPWindow(HWND parent, std::string title) : MRPWindow(parent, title) { for (int i = 0; i < 8; ++i) { auto but = std::make_shared<WinButton>(this, std::to_string(i)); but->GenericNotifyCallback = [i](GenericNotifications) { readbg() << "you pressed " << i << "\n"; }; add_control(but); } // Button 0 toggless enabled state of button 1 m_controls[0]->GenericNotifyCallback = [this](GenericNotifications) { m_controls[1]->setEnabled(!m_controls[1]->isEnabled()); }; m_envcontrol1 = std::make_shared<EnvelopeControl>(this); // Button 3 toggless enabled state of envelope control m_controls[3]->GenericNotifyCallback = [this](GenericNotifications) { m_envcontrol1->setEnabled(!m_envcontrol1->isEnabled()); }; // Button 7 toggless visible state of button 0 m_controls[7]->GenericNotifyCallback = [this](GenericNotifications) { m_controls[0]->setVisible(!m_controls[0]->isVisible()); }; auto env = std::make_shared<breakpoint_envelope>("foo", LICE_RGBA(255, 255, 255, 255)); env->add_point({ 0.0, 0.5 , envbreakpoint::Power, 0.5 }, true); env->add_point({ 0.5, 0.0 , envbreakpoint::Power, 0.5 }, true); env->add_point({ 1.0, 0.5 }, true); m_envcontrol1->add_envelope(env); m_envcontrol1->GenericNotifyCallback = [this, env](GenericNotifications reason) { //if (reason == GenericNotifications::AfterManipulation) // generate_items_sequence(env, m_edit1->getText().c_str()); }; add_control(m_envcontrol1); // Button 5 does some Xenakios silliness m_controls[5]->GenericNotifyCallback = [this, env](GenericNotifications) { generate_items_sequence(env, m_edit1->getText().c_str()); }; m_label1 = std::make_shared<WinLabel>(this, "This is a label"); add_control(m_label1); m_edit1 = std::make_shared<WinLineEdit>(this, "C:/MusicAudio/pihla_ei/ei_mono_005.wav"); add_control(m_edit1); m_edit1->TextCallback = [this](std::string txt) { m_label1->setText(txt); }; // Button 6 launches bogus work in another thread to demo progress bar m_controls[6]->GenericNotifyCallback = [this](GenericNotifications) { m_progressbar1->setVisible(true); // we don't deal with multiple background tasks now, so disable the button to start the task m_controls[6]->setEnabled(false); static int rseed = 0; auto task = [this](int randseed) { std::mt19937 randgen(randseed); std::uniform_real_distribution<double> randdist(0.0, 1.0); double accum = 0.0; const int iterations = 50000000; double t0 = time_precise(); for (int i = 0; i < iterations; ++i) { accum += randdist(randgen); //accum += randdist(randgen); // Production code should not do this at this granularity, because setProgressValue deals with // an atomic value. but this is just a demo... m_progressbar1->setProgressValue(1.0 / iterations*i); } double t1 = time_precise(); auto finishtask = [=]() { m_edit1->setText(std::to_string(accum) + " elapsed time " + std::to_string(t1-t0)); m_progressbar1->setProgressValue(0.0); m_progressbar1->setVisible(false); m_controls[6]->setEnabled(true); }; execute_in_main_thread(finishtask); }; m_future1 = std::async(std::launch::async, task, rseed); ++rseed; }; // Button 1 shows popup menu m_controls[1]->GenericNotifyCallback = [this, env](GenericNotifications) { PopupMenu popmenu(getWindowHandle()); popmenu.add_menu_item("Menu entry 1", [](PopupMenu::CheckState) {}); popmenu.add_menu_item("Menu entry 2", m_menuitem2state, [this](PopupMenu::CheckState cs) { m_menuitem2state = cs; }); popmenu.add_menu_item("Menu entry 3", m_menuitem3state, [this](PopupMenu::CheckState cs) { m_menuitem3state = cs; }); PopupMenu submenu(getWindowHandle()); submenu.add_menu_item("Submenu entry 1", [](PopupMenu::CheckState) { readbg() << "submenu entry 1\n"; }); submenu.add_menu_item("Submenu entry 2", [](PopupMenu::CheckState) { readbg() << "submenu entry 2\n"; }); PopupMenu subsubmenu(getWindowHandle()); for (int i = 0; i < 8; ++i) { subsubmenu.add_menu_item(std::string("Subsubmenu entry ") + std::to_string(i + 1), [i](PopupMenu::CheckState) { readbg() << "subsubmenu entry " << i + 1 << "\n"; }); } submenu.add_submenu("Going still deeper", subsubmenu); popmenu.add_submenu("More stuff", submenu); popmenu.execute(m_controls[1]->getXPosition(), m_controls[1]->getYPosition()); }; // Button 4 removes envelope points with value over 0.5 m_controls[4]->GenericNotifyCallback = [this, env](GenericNotifications) { env->remove_points_conditionally([](const envbreakpoint& pt) { return pt.get_y() > 0.5; }); m_envcontrol1->repaint(); }; m_combo1 = std::make_shared<WinComboBox>(this); m_combo1->addItem("Apple", -9001); m_combo1->addItem("Pear", 666); m_combo1->addItem("Kiwi", 42); m_combo1->addItem("Banana", 100); m_combo1->SelectedChangedCallback = [this](int index) { int user_id = m_combo1->userIDfromIndex(index); readbg() << "combo index " << index << " userid " << user_id << "\n"; }; add_control(m_combo1); m_combo1->setSelectedUserID(42); m_combo2 = std::make_shared<WinComboBox>(this); m_combo2->addItem("Item 1", 100); m_combo2->addItem("Item 2", 101); m_combo2->addItem("Item 3", 102); m_combo2->addItem("Item 4", 103); m_combo2->SelectedChangedCallback = [this](int index) { int user_id = m_combo2->userIDfromIndex(index); readbg() << "combo index " << index << " userid " << user_id << "\n"; }; add_control(m_combo2); m_combo2->setSelectedIndex(0); m_slider1 = std::make_shared<ReaSlider>(this, 0.5); //m_slider1->setValueConverter(std::make_shared<FFTSizesValueConverter>()); m_slider1->SliderValueCallback = [this](GenericNotifications, double x) { m_label1->setText(std::to_string(x)); m_progressbar1->setProgressValue(x); }; add_control(m_slider1); m_zoomscroll1 = std::make_shared<ZoomScrollBar>(this); add_control(m_zoomscroll1); m_zoomscroll1->RangeChangedCallback = [this](double t0, double t1) { m_envcontrol1->setViewTimeRange(t0, t1); }; m_progressbar1 = std::make_shared<ProgressControl>(this); m_progressbar1->setVisible(false); }
int main(void) { int choice, inner, position, data; while(1) { printf("\n1. Insert\n" "2. Delete\n" "3. Display\n" "4. Exit\n" "Please Choose: " ); scanf("%d", &choice); switch(choice) { case 1: printf("Insert..\n"); submenu(0); scanf("%d", &inner); printf("Enter data to be inserted: "); scanf("%d", &data); switch(inner) { case 1: insert(data, inner, -1); break; case 2: printf("Enter position: "); scanf("%d", &position); insert(data, inner, position); break; case 3: break; case 4: break; default: printf("Wrong option\n"); } break; case 2: printf("Delete..\n"); submenu(1); scanf("%d", &inner); printf("Enter data to be inserted: "); scanf("%d", &data); switch(inner) { case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; default: printf("Wrong option\n"); } break; case 3: display(); break; case 4: return 0; break; default: printf("Wrong option\n"); } } return 0; }
int main(){SetConsoleTitle("세상에서 가장 어려운 숫자야구");system("mode con lines=30 cols=58");void submenu();extern int**recnum;extern int*recsum;extern int*chack;extern int count;int i,p;double std;mv();printline('@',49);puts(" 세상에서 가장 어려운 숫자야구 ");mv();printline('@',49);puts("");printf(" * Easy");printf(" * Medium\n");puts("");printf(" 1) 두자리");printf(" 3) 네자리\n");printf(" 2) 세자리");printf(" 4) 다섯자리\n");puts("");printf(" * Hard");printf(" * Hell\n");puts("");printf(" 5) 여섯자리");printf(" 7) 여덟자리\n");printf(" 6) 일곱자리");printf(" 8) 아홉자리\n");puts("");puts(" 0) 종료");puts("");mv();printline('@',49);puts("");printf(" :");scanf("%d",&i);if(i==0){return 0;} mkrandnum(i);recnum=(int**)malloc(sizeof(int*)*(25*i));recsum=(int*)malloc(sizeof(int)*(25*i));chack=(int*)malloc(sizeof(int)*(25*i));while(onoff){system("cls");count++;relay(i,count);if(onoff==0)break;recorder(count,i);submenu(i);} std=(double)(104-(4/i)*count);puts("");mv();printf("점수는 %0.2f 점 입니다.\n",(double)(104-(4/i)*count));if(100>=std&&std>=80){mv();puts("이 점수는 .. 상위 10% 십니다. 비결이 뭐죠?");} if(80>std&&std>=60){mv();puts("이 점수는 .. 상위 30% 십니다. 재능이 있네요.");} if(60>std&&std>=40){mv();puts("이 점수는 .. 중위권 십니다. 상위권 진출이 얼마 안남았네요.");} if(40>std&&std>=20){mv();puts("이 점수는 .. 열심히 노력하세요. 중위권이 얼마 남지 않았어요.");} if(20>std&&std>=4){mv();puts("이 점수는 .. 초보시군요. 더 좋은 점수 기대할게요.");} if(4>std){mv();puts("error");} puts("");for(p=0;p<=i;p++);{free(recnum[p]);} free(recnum);free(recsum);free(chack);free(n);free(user);mv();system("pause");return 0;}