Пример #1
0
int main(void){
  char str_s[5];
  char str_v[20];
  char str_o[50];
  char str_m[5];
  char *sp=str_s;
  char *vp=str_v;
  char *op=str_o;
  char *mp=str_m;
  scanf("%s",str_s);
  scanf("%s",str_v);
  scanf("%s",str_o);
  if(*str_s == 'H'){
    str_copy(str_s,"he");
    str_copy(str_m,"does");
    no_s(str_v);
  }else if(*str_s == 'S') {
    str_copy(str_s,"she");
    str_copy(str_m,"does");
    no_s(str_v);
  }else if(*str_s =='I') {
    str_copy(str_s,"you");
    str_copy(str_m,"do");
  }else{
    str_copy(str_s,"they");
    str_copy(str_m,"do");
  }
  printf("What ");
  printf("%s ", str_m);
  printf("%s ", str_s);
  printf("%s", str_v);
  printf("?\n");
  return 0;
}
Пример #2
0
void run_command() {

  if (command == "create") {
    no_r(); no_s();
    require_parameter_count(1);
    hashdb_settings_t new_settings;
    if (has_byte_alignment) {
      new_settings.byte_alignment = optional_byte_alignment;
    }
    if (has_hash_truncation) {
      new_settings.hash_truncation= optional_hash_truncation;
    }
    if (has_hash_block_size) {
      new_settings.hash_block_size = optional_hash_block_size;
    }
    if (has_max) {
      new_settings.maximum_hash_duplicates = optional_max;
    }
    manage_bloom_settings(new_settings);
    commands_t::create(hashdb_arg1, new_settings);
  } else if (command == "import") {
    no_a(); no_t(); no_p(); no_m(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    // compose a repository name if one is not provided
    if (!has_repository_name) {
      repository_name_string = "repository_" + hashdb_arg1;
    }
    commands_t::import(hashdb_arg1, hashdb_arg2, repository_name_string);
  } else if (command == "import_tab") {
    no_a(); no_t(); no_p(); no_m(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    // compose a repository name if one is not provided
    if (!has_repository_name) {
      repository_name_string = "repository_" + hashdb_arg1;
    }
    uint32_t import_tab_sector_size = (has_sector_size) ? optional_sector_size :
                                   globals_t::default_import_tab_sector_size;
    commands_t::import_tab(hashdb_arg1, hashdb_arg2, repository_name_string,
                                                     import_tab_sector_size);
  } else if (command == "export") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::do_export(hashdb_arg1, hashdb_arg2);
  } else if (command == "add") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::add(hashdb_arg1, hashdb_arg2);
  } else if (command == "add_multiple") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::add_multiple(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "add_repository") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::add_repository(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "intersect") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::intersect(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "intersect_hash") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::intersect_hash(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "subtract") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::subtract(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "subtract_hash") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::subtract_hash(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "subtract_repository") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(3);
    commands_t::subtract_repository(hashdb_arg1, hashdb_arg2, hashdb_arg3);
  } else if (command == "deduplicate") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::deduplicate(hashdb_arg1, hashdb_arg2);
  } else if (command == "scan") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::scan(hashdb_arg1, hashdb_arg2);
  } else if (command == "scan_hash") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::scan_hash(hashdb_arg1, hashdb_arg2);
  } else if (command == "scan_expanded") {
    no_a(); no_t(); no_p(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    uint32_t scan_expanded_max = (has_max) ? optional_max :
                                        globals_t::default_scan_expanded_max;
    commands_t::scan_expanded(hashdb_arg1, hashdb_arg2, scan_expanded_max);
  } else if (command == "scan_expanded_hash") {
    no_a(); no_t(); no_p(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    uint32_t scan_expanded_hash_max = (has_max) ? optional_max :
                                        globals_t::default_scan_expanded_max;
    commands_t::scan_expanded_hash(hashdb_arg1, hashdb_arg2, scan_expanded_hash_max);
  } else if (command == "size") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(1);
    commands_t::size(hashdb_arg1);
  } else if (command == "sources") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(1);
    commands_t::sources(hashdb_arg1);
  } else if (command == "histogram") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(1);
    commands_t::histogram(hashdb_arg1);
  } else if (command == "duplicates") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::duplicates(hashdb_arg1, hashdb_arg2);
  } else if (command == "hash_table") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::hash_table(hashdb_arg1, hashdb_arg2);
  } else if (command == "expand_identified_blocks") {
    uint32_t expand_max = (has_max) ? optional_max :
                            globals_t::default_expand_identified_blocks_max;
    no_a(); no_t(); no_p(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::expand_identified_blocks(hashdb_arg1, hashdb_arg2, expand_max);
  } else if (command == "explain_identified_blocks") {
    no_a(); no_t(); no_p(); no_r(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    uint32_t explain_max = (has_max) ? optional_max :
                            globals_t::default_explain_identified_blocks_max;
    commands_t::explain_identified_blocks(hashdb_arg1, hashdb_arg2,
                                                      explain_max);
  } else if (command == "rebuild_bloom") {
    no_a(); no_t(); no_p(); no_m(); no_r(); no_s();
    require_parameter_count(1);
    hashdb_settings_t rebuild_settings;
    manage_bloom_settings(rebuild_settings);
    commands_t::rebuild_bloom(rebuild_settings, hashdb_arg1);
  } else if (command == "add_random") {
    no_a(); no_t(); no_p(); no_m(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    // compose a repository name if one is not provided
    if (!has_repository_name) {
      repository_name_string = "repository_" + hashdb_arg1;
    }
    commands_t::add_random(hashdb_arg1, hashdb_arg2, repository_name_string);
  } else if (command == "scan_random") {
    no_a(); no_t(); no_p(); no_m(); no_s(); no_A(); no_B(); no_C();
    require_parameter_count(2);
    commands_t::scan_random(hashdb_arg1, hashdb_arg2);
  } else {
    // invalid command
    std::cerr << "Error: '" << command << "' is not a recognized command.  " << see_usage << "\n";
  }
}