Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int i, n, w, a;
- char s[10][1001];
- int len[100];
- char name[10][1001];
- char height[10][1001];
- int h[100];
- scanf("%d%d", &n, &w);
- getchar();
- for(i=0;i<n;i++){
- gets(s[i]);
- len[i]=strlen(s[i]);
- int j=0;
- int k=0;
- for(a=0;a<len[i];a++){
- if(s[i][a]>='0' && s[i][a]<='9'){
- height[i][j]=s[i][a];
- j++;
- }
- else{
- name[i][k]=s[i][a];
- k++;
- }
- }
- k-=2;
- h[i]=atoi(height[i]);
- if(h[i]>w){
- for(a=0;a<=k;a++){
- printf("%c", name[i][a]);
- }
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement