Finish Tests
This commit is contained in:
parent
3315118690
commit
4992ad603e
13 changed files with 398 additions and 53 deletions
67
bebbow.c
Normal file
67
bebbow.c
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
void parseH(char *p);
|
||||
void parseL(char *p);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
// Start measuring time
|
||||
struct timespec begin, end;
|
||||
clock_gettime(CLOCK_REALTIME, &begin);
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
char c[] = "qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890qwertyuiopasdfghjkllzxcvbnm123456789mnbvcxzlkjhgfdsapoiuytrewq1234567890";
|
||||
|
||||
parseH(c);
|
||||
parseL(c);
|
||||
//printf("%s\n", c);
|
||||
|
||||
// Stop measuring time and calculate the elapsed time
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
long seconds = end.tv_sec - begin.tv_sec;
|
||||
long nanoseconds = end.tv_nsec - begin.tv_nsec;
|
||||
double elapsed = seconds + nanoseconds * 1e-9;
|
||||
|
||||
printf("Time measured: %.10f seconds.\n", elapsed);
|
||||
//
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void parseH(char *p)
|
||||
{
|
||||
|
||||
|
||||
|
||||
char *t ;
|
||||
t=p;
|
||||
while(*t!=0){
|
||||
if(*t>96 && *t<123){
|
||||
*t=*t-32;
|
||||
}
|
||||
t++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void parseL(char *p)
|
||||
{
|
||||
|
||||
char *t ;
|
||||
t=p;
|
||||
while(*t!=0){
|
||||
if(*t>64 && *t<91){
|
||||
*t=*t+32;
|
||||
}
|
||||
t++;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue