#include<stdio.h>
void ret(char* ch) {
while (*ch != '\0') {
if (*ch == 'a' || *ch == 'e' || *ch == 'i' || *ch == 'o' || *ch == 'u' || *ch == 'A' || *ch == 'E' || *ch == 'I' || *ch == 'O' || *ch == 'U') {
printf("%c", *ch);
}
ch++;
}
}
int main() {
char ch[100] = { 0 };
gets(ch);
ret(ch);
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
struct Employee {
char name[50];
int id;
};
void inputEmployees(struct Employee employees[]) {
for (int i = 0; i < 10; i++) {
scanf("%s%d", employees[i].name, &employees[i].id);
}
}
void sortEmployees(struct Employee employees[]) {
struct Employee temp;
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9 - i; j++) {
if (employees[j].id > employees[j + 1].id) {
int idTemp = employees[j].id;
employees[j].id = employees[j + 1].id;
employees[j + 1].id = idTemp;
strcpy(temp.name, employees[j].name);
strcpy(employees[j].name, employees[j + 1].name);
strcpy(employees[j + 1].name, temp.name);
}
}
}
}
char* searchEmployee(struct Employee employees[], int id) {
int left = 0;
int right = 9;
while (left <= right) {
int mid = (left + right) / 2;
if (employees[mid].id == id) {
return employees[mid].name;
}
else if (employees[mid].id < id) {
left = mid + 1;
}
else {
right = mid - 1;
}
}
return "未找到";
}
int main() {
struct Employee employees[10];
inputEmployees(employees);
sortEmployees(employees);
for (int i = 0; i < 10; i++) {
printf("%s %d\n", employees[i].name, employees[i].id);
}
int searchId;
scanf("%d", &searchId);
char* foundName = searchEmployee(employees, searchId);
printf("%s\n", foundName);
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
char* month[12] = { "January","February","March","April","May","June","July","August","September","October","November","December" };
int num;
scanf("%d", &num);
num--;
printf("%s\n", *(month + num));
return 0;
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef _MSC_VER
#define strdup _strdup
#endif
void sortStrings(char** strings, int count) {
char* temp;
for (int i = 0; i < count - 1; i++) {
for (int j = 0; j < count - i - 1; j++) {
if (strcmp(strings[j], strings[j + 1]) > 0) {
temp = strings[j];
strings[j] = strings[j + 1];
strings[j + 1] = temp;
}
}
}
}
int main() {
char* strings[5];
for (int i = 0; i < 5; i++) {
char input[50];
fgets(input, sizeof(input), stdin);
input[strcspn(input, "\n")] = 0;
strings[i] = strdup(input);
}
sortStrings(strings, 5);
for (int i = 0; i < 5; i++) {
puts(strings[i]);
}
return 0;
}
#include<stdio.h>
struct person {
char name[20];
int count;
}leader[3] = { "Li",0,"Zhang",0,"Fun",0 };
int main()
{
int n, i;
scanf_s("%d", &n);
getchar();
char a[100][10];
for (i = 0; i < n; ++i)
{
gets(a[i]);
}
for (i = 0; i < n; ++i)
{
if (a[i][0] == 'L')
++(leader[0].count);
else if (a[i][0] == 'Z')
++(leader[1].count);
else
++(leader[2].count);
}
printf("Li:%d\nZhang:%d\nFun:%d\n", leader[0].count, leader[1].count, leader[2].count);
return 0;
}