这篇教程C++ yes函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中yes函数的典型用法代码示例。如果您正苦于以下问题:C++ yes函数的具体用法?C++ yes怎么用?C++ yes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了yes函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainmain (){ printf (MSG ("/nFORMAT 4K %s %s/n", "/nРАЗМЕТКА 4K %s %s/n"), BOOTVERSION, MSG (LCOPYRIGHT, RCOPYRIGHT)); printf (MSG ("/nUsing this program you may OVERWRITE information on your hard disks./n", "/nПри работе с этой программой Вы можете ЗАТЕРЕТЬ информацию на дисках./n")); printf (MSG ("/nIt is strongly recommended to TURN unnecessary disks 'READ-ONLY'./n", "/nНастоятельно рекомендуется ЗАКРЫТЬ ненужные дискм на ЗАПИСЬ./n")); printf (MSG ("Do you want to continue", "Продолжать")); if (yes () != 1) return; unit = getunit (); nbad = 0; printf (MSG ("/nFormat unit %d", "/nФорматировать устройство %d"), unit); if (yes () != 1) return; /* инициализация переменных и массивов разметки */ init (unit); printf (MSG ("/nINITIAL FORMATTING/n", "/nПЕРВИЧНАЯ РАЗМЕТКА/n")); if (! format1 ()) return; if (nbad) { printf (MSG ("/nBAD TRACKS REMAPPING/n", "/nДЕФЕКТАЦИЯ/n")); if (! format2 ()) return; } printf (MSG ("/nFormat completed./n", "/nФорматирование закончено./n"));}
开发者ID:denrusio,项目名称:vak-opensource,代码行数:32,
示例2: solvevoid solve(int n,int K){ if(n<=2){ yes(); return; } int mf[12]; for(int i=0;i<12;i++){ mf[i]=0; } for(int i=0;i<n;i++){ mf[x[i]%(K+1)]++; } int c=0; int f[12]; for(int i=0;i<12;i++){ if(mf[i]>0){ f[c++]=i; } } if(c==1){ yes(); return; } if(c==2){ if(mf[f[0]]==1||mf[f[1]]==1){ yes(); return; } } no();}
开发者ID:nitin-nizhawan,项目名称:incubator,代码行数:32,
示例3: dievoiddie(int entry) /* label 90 */{ int i; if (entry != 99) { rspeak(23); oldlc2 = loc; } if (closng) { /* 99 */ rspeak(131); numdie++; done(2); } yea = yes(81 + numdie * 2, 82 + numdie * 2, 54); numdie++; if (numdie == maxdie || !yea) done(2); place[water] = 0; place[oil] = 0; if (toting(lamp)) prop[lamp] = 0; for (i = 100; i >= 1; i--) { if (!toting(i)) continue; k = oldlc2; if (i == lamp) k = 1; drop(i, k); } loc = 3; oldloc = loc;}
开发者ID:lattera,项目名称:openbsd,代码行数:33,
示例4: TESTTEST(plankton, env_construction) { CREATE_RUNTIME(); // Environment references resolve correctly to ast factories. { byte_buffer_t buf; byte_buffer_init(&buf); write_ast_factory(&buf, "Literal"); value_t value = deserialize(runtime, &buf); ASSERT_FAMILY(ofFactory, value); byte_buffer_dispose(&buf); } // Objects with ast factory headers produce asts. { byte_buffer_t buf; byte_buffer_init(&buf); byte_buffer_append(&buf, pObject); write_ast_factory(&buf, "Literal"); byte_buffer_append(&buf, pMap); plankton_wire_encode_uint32(&buf, 1); write_string(&buf, "value"); byte_buffer_append(&buf, pTrue); value_t value = deserialize(runtime, &buf); ASSERT_FAMILY(ofLiteralAst, value); ASSERT_VALEQ(yes(), get_literal_ast_value(value)); byte_buffer_dispose(&buf); } DISPOSE_RUNTIME();}
开发者ID:plesner,项目名称:neutrino,代码行数:31,
示例5: setVisiblevoid QQuickDialog::click(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role){ setVisible(false); m_clickedButton = static_cast<StandardButton>(button); emit buttonClicked(); switch (role) { case QPlatformDialogHelper::AcceptRole: emit accept(); break; case QPlatformDialogHelper::RejectRole: emit reject(); break; case QPlatformDialogHelper::DestructiveRole: emit discard(); break; case QPlatformDialogHelper::HelpRole: emit help(); break; case QPlatformDialogHelper::YesRole: emit yes(); break; case QPlatformDialogHelper::NoRole: emit no(); break; case QPlatformDialogHelper::ApplyRole: emit apply(); break; case QPlatformDialogHelper::ResetRole: emit reset(); break; default: qWarning("unhandled Dialog button %d with role %d", (int)button, (int)role); }}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:34,
示例6: metadata_filterstatic intmetadata_filter(struct archive *a, void *_data, struct archive_entry *entry){ struct bsdtar *bsdtar = (struct bsdtar *)_data; /* XXX TODO: check whether this filesystem is * synthetic and/or local. Add a new * --local-only option to skip non-local * filesystems. Skip synthetic filesystems * regardless. * * The results should be cached, since * tree.c doesn't usually visit a directory * and the directory contents together. A simple * move-to-front list should perform quite well. * * Use archive_read_disk_current_filesystem_is_remote(). */ /* * If the user vetoes this file/directory, skip it. * We want this to be fairly late; if some other * check would veto this file, we shouldn't bother * the user with it. */ if (bsdtar->option_interactive && !yes("add '%s'", archive_entry_pathname(entry))) return (0); /* Note: if user vetoes, we won't descend. */ if (!bsdtar->option_no_subdirs && archive_read_disk_can_descend(a)) archive_read_disk_descend(a); return (1);}
开发者ID:AAZemlyanukhin,项目名称:freebsd,代码行数:35,
示例7: TESTTEST(syntax, emitting) { CREATE_RUNTIME(); value_t ast = new_heap_literal_ast(runtime, yes()); assembler_t assm; ASSERT_SUCCESS(assembler_init(&assm, runtime, nothing(), scope_get_bottom())); ASSERT_SUCCESS(emit_value(ast, &assm)); assembler_emit_return(&assm); value_t code = assembler_flush(&assm); ASSERT_SUCCESS(code); value_t result = run_code_block_until_condition(ambience, code); ASSERT_VALEQ(yes(), result); assembler_dispose(&assm); DISPOSE_RUNTIME();}
开发者ID:plesner,项目名称:neutrino,代码行数:16,
示例8: ivquit/* QUIT intransitive only. Verify intent and exit if that's what he wants*/void ivquit(){ gaveup = yes(22, 54, 54); if (gaveup) normend(); return;}
开发者ID:BackupTheBerlios,项目名称:ramrodminix-svn,代码行数:10,
示例9: vread/* READ etc.*/vread(){ int msg; msg = 0; if (dark()) { printf("I see no %s here./n",probj(object)); return; } switch(object) { case MAGAZINE: msg = 190; break; case TABLET: msg = 196; break; case MESSAGE: msg = 191; break; case OYSTER: if (!toting(OYSTER) || !closed) break; yes(192,193,54); return; default: ; } if (msg) rspeak(msg); else actspk(verb);}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:35,
示例10: mainint main(){try{ cout << "Are you thinking of an animal? (Yes or No) "; bool question1 = yes(); cout << "Are you thinking of an actor? (Yes or No) "; bool question2 = yes(); cout << "Are you thinking of something that likes the water? (Yes or No) "; bool question3 = yes(); if(question1 && !question2 && !question3){ cout << endl << "You must be thinking of a dog.";} else if(question1 && question2 && !question3){ cout << endl << "You must be thinking of Clifford the Big Red Dog.";} else if(question1 && question2 && question3){ cout << endl << "You must be thinking of Shamu.";} else if(!question1 && question2 && question3){ cout << endl << "You must be thinking of David Hasslehoff.";} else if(!question1 && question2 && !question3){ cout << endl << "You must be thinking of Tom Cruise in Top Gun.";} else if(!question1 && !question2 && question3){ cout << endl << "You must be thinking of a carrot.";} else if(question1 && !question2 && question3){ cout << endl << "You must be thinking of a fish.";} else if(!question1 && !question2 && !question3){ cout << endl << "You must be thinking of fresh, new pair of Jordans.";} cout << endl; return 0; } catch(exception&e){ cerr << "error: " << e.what() << endl; keep_window_open(); return 1;} catch(...){ cerr << "unknown exception" << endl; keep_window_open(); return 2;} }
开发者ID:dqharris6,项目名称:Texas-A-M,代码行数:47,
示例11: yesvoid RecordConfirmationDialog::yesClicked(){ emit yes(); if (remember->isChecked()) { settings.setAutoRecord(skypeName, AUTO_RECORD_ON); } accept();}
开发者ID:proton,项目名称:SkypeRec,代码行数:9,
示例12: AskMessageYesNoMessage::YesNoMessage(const QString& action, QWidget *parent) : AskMessage("YesNoMessage", parent), ui(new Ui::YesNoMessage){ ui->setupUi(this); ui->label->setText("<center>" + tr("Do you really want to ") + action + "</center>"); connect(ui->yes, SIGNAL(clicked()), SLOT(yes())); connect(ui->no, SIGNAL(clicked()), SLOT(no()));}
开发者ID:rasmadeus,项目名称:Rragraph,代码行数:9,
示例13: matchBoolean void matchBoolean() const { givenACodeSampleToTokenize yes("YES", true); ASSERT_EQUALS(false, Token::Match(yes.tokens(), "%bool%")); givenACodeSampleToTokenize positive("true", true); ASSERT_EQUALS(true, Token::Match(positive.tokens(), "%bool%")); givenACodeSampleToTokenize negative("false", true); ASSERT_EQUALS(true, Token::Match(negative.tokens(), "%bool%")); }
开发者ID:thomasjfox,项目名称:cppcheck,代码行数:10,
示例14: QDialogSaveChangesDialog::SaveChangesDialog(const QStringList& files, QWidget *parent) : QDialog(parent){ ui.setupUi(this); ui.fileList->addItems(files); connect(ui.yes, SIGNAL(clicked()), this, SLOT(yes())); connect(ui.no, SIGNAL(clicked()), this, SLOT(no())); connect(ui.cancel, SIGNAL(clicked()), this, SLOT(cancel()));}
开发者ID:Nlcke,项目名称:gideros,代码行数:10,
示例15: standardNamesQSet<QString> standardNames(){ static QSet<QString> names; if (names.isEmpty()) { QStringList strings = QStringList() << ok().text << cancel().text << yes().text << no().text << discard().text << save().text << apply().text << close().text << help().text << overwrite().text << reset().text << cont().text << del().text << stop().text << remove().text << back().text << forward().text; foreach (QString s, strings) { names.insert(s.remove("&")); }
开发者ID:BinChengfei,项目名称:cantata,代码行数:11,
示例16: mainint main(int argc, char *argv[]) { RmStat stat_buf; bool has_gid, has_uid; RmUserGroupNode **list = rm_userlist_new(); if(argc < 2) { puts("Usage: prog <path>"); return EXIT_FAILURE; } if(rm_sys_stat(argv[1], &stat_buf) != 0) { return EXIT_FAILURE; } printf("File has UID %"LLU" and GID %"LLU"/n", (unsigned long)stat_buf.st_uid, (unsigned long)stat_buf.st_gid ); rm_userlist_contains(list, stat_buf.st_uid, stat_buf.st_gid, &has_uid, &has_gid); printf("=> Valid UID = %s/n", yes(has_uid)); printf("=> Valid GID = %s/n", yes(has_gid)); rm_userlist_destroy(list); return EXIT_SUCCESS;}
开发者ID:icedawn,项目名称:rmlint,代码行数:21,
示例17: startupvoidstartup(void){ demo = Start(); srandomdev(); hinted[3] = yes(65, 1, 0); newloc = 1; delhit = 0; limit = 330; if (hinted[3]) limit = 1000; /* better batteries if instrucs */}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:12,
示例18: startupstartup(){ time_t time(); demo=Start(0); srand((int)(time((time_t *)NULL))); /* random seed */ /* srand(371); /* non-random seed */ hinted[3]=yes(65,1,0); newloc=1; delhit = 0; limit=330; if (hinted[3]) limit=1000; /* better batteries if instrucs */}
开发者ID:tewemit,项目名称:CodingChallenges,代码行数:14,
示例19: heap_object_identity_comparestatic value_t heap_object_identity_compare(value_t a, value_t b, cycle_detector_t *detector) { CHECK_DOMAIN(vdHeapObject, a); CHECK_DOMAIN(vdHeapObject, b); // Fast case when a and b are the same object. if (is_same_value(a, b)) return yes(); heap_object_family_t a_family = get_heap_object_family(a); heap_object_family_t b_family = get_heap_object_family(b); if (a_family != b_family) return no(); family_behavior_t *behavior = get_heap_object_family_behavior(a); return (behavior->identity_compare)(a, b, detector);}
开发者ID:tundra,项目名称:neutrino,代码行数:14,
示例20: excluded_callbackstatic voidexcluded_callback(struct archive *a, void *_data, struct archive_entry *entry){ struct bsdtar *bsdtar = (struct bsdtar *)_data; if (bsdtar->option_no_subdirs) return; if (!archive_read_disk_can_descend(a)) return; if (bsdtar->option_interactive && !yes("add '%s'", archive_entry_pathname(entry))) return; archive_read_disk_descend(a);}
开发者ID:AAZemlyanukhin,项目名称:freebsd,代码行数:14,
示例21: fopen_svoid setting::save(){ FILE *f; fopen_s(&f, "..//file//config.ini", "w"); double d; int i; QString n("/n"); QString yes("T"); QString no("F"); QString Q("Quality="); QString R("Raft="); QString S("Support="); QString L("LayerHeight="); QString I("Infill="); QString N("NumofShells="); QString T("Temperature="); QString M("ModelHeight="); i = ui.Quality->currentIndex()+1; QString s = QString::number(i, 10); Q = Q + s + n; if (ui.Raft->isChecked())R = R + yes + n; else R = R + no + n; if (ui.Support->isChecked())S = S + yes + n; else S = S + no + n; d = ui.LayerHeight->value(); L = L + QString::number(d,'g',3) + n; i = ui.Infill->value(); I = I + QString::number(i,10) + n; i = ui.NumofShells->value(); N = N + QString::number(i, 10) + n; i = ui.Temperature->value(); T = T + QString::number(i, 10) + n; i = ui.ModelHeight->value(); M = M + QString::number(i, 10) + n; QString result = Q + R + S + L + I + N + T + M; fwrite(Qs2c(result), result.length(), 1, f); fclose(f); this->close();}
开发者ID:jsjjsyc,项目名称:3D_Editor,代码行数:49,
示例22: append_archivestatic intappend_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina){ struct archive_entry *in_entry; int e; while (0 == archive_read_next_header(ina, &in_entry)) { if (!new_enough(bsdtar, archive_entry_pathname(in_entry), archive_entry_stat(in_entry))) continue; if (excluded(bsdtar, archive_entry_pathname(in_entry))) continue; if (bsdtar->option_interactive && !yes("copy '%s'", archive_entry_pathname(in_entry))) continue; if (bsdtar->verbose) safe_fprintf(stderr, "a %s", archive_entry_pathname(in_entry)); siginfo_setinfo(bsdtar, "copying", archive_entry_pathname(in_entry), archive_entry_size(in_entry)); siginfo_printinfo(bsdtar, 0); e = archive_write_header(a, in_entry); if (e != ARCHIVE_OK) { if (!bsdtar->verbose) bsdtar_warnc(bsdtar, 0, "%s: %s", archive_entry_pathname(in_entry), archive_error_string(a)); else fprintf(stderr, ": %s", archive_error_string(a)); } if (e == ARCHIVE_FATAL) exit(1); if (e >= ARCHIVE_WARN) { if (archive_entry_size(in_entry) == 0) archive_read_data_skip(ina); else if (copy_file_data(bsdtar, a, ina)) exit(1); } if (bsdtar->verbose) fprintf(stderr, "/n"); } /* Note: If we got here, we saw no write errors, so return success. */ return (0);}
开发者ID:marccodes,项目名称:lfl,代码行数:49,
示例23: startupvoidstartup(void){ demo = Start(); srand((int)time(NULL)); /* random seed */#if 0 srand(371); /* non-random seed */#endif hinted[3] = yes(65, 1, 0); newloc = 1; delhit = 0; limit = 330; if (hinted[3]) limit = 1000; /* better batteries if instrucs */}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:15,
示例24: append_archivestatic intappend_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina){ struct archive_entry *in_entry; int e; while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) { if (archive_match_excluded(bsdtar->matching, in_entry)) continue; if (bsdtar->option_interactive && !yes("copy '%s'", archive_entry_pathname(in_entry))) continue; if (bsdtar->verbose > 1) { safe_fprintf(stderr, "a "); list_item_verbose(bsdtar, stderr, in_entry); } else if (bsdtar->verbose > 0) safe_fprintf(stderr, "a %s", archive_entry_pathname(in_entry)); if (need_report()) report_write(bsdtar, a, in_entry, 0); e = archive_write_header(a, in_entry); if (e != ARCHIVE_OK) { if (!bsdtar->verbose) lafe_warnc(0, "%s: %s", archive_entry_pathname(in_entry), archive_error_string(a)); else fprintf(stderr, ": %s", archive_error_string(a)); } if (e == ARCHIVE_FATAL) exit(1); if (e >= ARCHIVE_WARN) { if (archive_entry_size(in_entry) == 0) archive_read_data_skip(ina); else if (copy_file_data_block(bsdtar, a, ina, in_entry)) exit(1); } if (bsdtar->verbose) fprintf(stderr, "/n"); } return (e == ARCHIVE_EOF ? ARCHIVE_OK : e);}
开发者ID:nanakom,项目名称:freebsd,代码行数:46,
示例25: askAboutRelinkstatic intaskAboutRelink(int32_t clusterNum){ /* * Display the size of the chain for the user to consider. */ printOrphanInfo(clusterNum); /* * If we are in preen mode, preenBail won't return. */ preenBail("Need user confirmation to re-link orphaned chain./n"); (void) printf(gettext("Re-link orphaned chain into file system ? " "(y/n) ")); return (yes());}
开发者ID:AlainODea,项目名称:illumos-gate,代码行数:17,
示例26: askAboutFreeingstatic intaskAboutFreeing(int32_t clusterNum){ /* * If it is not OkayToRelink, we haven't already printed the size * of the orphaned chain. */ if (!OkayToRelink) printOrphanInfo(clusterNum); /* * If we are in preen mode, preenBail won't return. */ preenBail("Need user confirmation to free orphaned chain./n"); (void) printf( gettext("Free the allocation units in the orphaned chain ? " "(y/n) ")); return (yes());}
开发者ID:AlainODea,项目名称:illumos-gate,代码行数:19,
示例27: pass2void pass2(void){ blkno_t j; blkno_t oldtfree; int s; int yes(); printf("Rebuild free list? "); if (!yes()) return; oldtfree = swizzle16(superblock.s_tfree); /* Initialize the superblock-block */ superblock.s_ninode = 0; superblock.s_nfree = swizzle16(1); superblock.s_free[0] = 0; superblock.s_tfree = 0; /* Free each block, building the free list */ for (j = swizzle16(superblock.s_fsize) - 1; j >= swizzle16(superblock.s_isize); --j) { if (bitmap[j] == 0) { if (swizzle16(superblock.s_nfree) == 50) { dwrite(j, (char *) &superblock.s_nfree); superblock.s_nfree = 0; } superblock.s_tfree = swizzle16(swizzle16(superblock.s_tfree)+1); s = swizzle16(superblock.s_nfree); superblock.s_free[s++] = swizzle16(j); superblock.s_nfree = swizzle16(s); } } dwrite((blkno_t) 1, (char *) &superblock); if (oldtfree != swizzle16(superblock.s_tfree)) printf("During free list regeneration s_tfree was changed to %d from %d./n", swizzle16(superblock.s_tfree), oldtfree);}
开发者ID:NoSuchProcess,项目名称:FUZIX,代码行数:42,
示例28: mainint main(int argc, char *argv[]) { int rflag; /* user restore request option */ rflag = 0; dbugflg = 0; while (--argc > 0) { ++argv; if (**argv != '-') break; switch (tolower(argv[0][1])) { case 'r': ++rflag; continue; case 'd': ++dbugflg; continue; default: printf("unknown flag: %c/n", argv[0][1]); continue; } /* switch */ } /* while */ if (dbugflg < 2) dbugflg = 0; /* must request three times */ opentxt(); initplay(); if (rflag) restore(); else if (yes(65, 1, 0)) limit = 1000; else limit = 330; saveflg = 0; srand(511); /* seed random */ while (!saveflg) turn(); if (saveflg) saveadv();#ifndef EMBED fclose(fd1); fclose(fd2); fclose(fd3); fclose(fd4);#endif return (0); /* exit = ok */}
开发者ID:slacy,项目名称:advent4,代码行数:41,
示例29: death/* Routine to handle the passing on of one of the player's incarnations...*/void death(){ int yea, j; if (!g.closing) { if (g.limit < 0) { rspeak(185); normend(); return; } yea = yes(81 + g.numdie * 2, 82 + g.numdie * 2, 54); if (++g.numdie >= MAXDIE || !yea) normend(); if (g.chase) { g.chase = FALSE; g.prop[WUMPUS] = 0; move(WUMPUS, 174); } if (toting(LAMP)) g.prop[LAMP] = 0; for (j = 1; j < MAXOBJ; ++j) { if (toting(j)) drop(j, j == LAMP ? 1 : g.oldloc2); if (wearng(j)) { g.prop[j] = 0; bitoff(j, WEARBT); } } g.newloc = 3; g.oldloc = g.loc; g.health = 100; return; } /* Closing -- no resurrection... */ rspeak(131); ++g.numdie; normend(); return;}
开发者ID:quickgold192,项目名称:oslab1,代码行数:43,
注:本文中的yes函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ yes_no函数代码示例 C++ year函数代码示例 |