Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void Izbaci(char *s, int n) {
- char *p=s;
- while (*p!='\0') p++;
- int broj=0;
- while (*s!='\0') {
- if (*s>='0' && *s<='9') {
- char *poc=s;
- broj=broj*10+(*s-'0');
- s++;
- while (*s>='0' && *s<='9') {
- broj=broj*10+(*s-'0');
- s++;
- }
- char *kraj=s;
- poc--;
- if (broj>n) {
- while (*kraj!='\0') {
- *poc++=*kraj++;
- } *(p-(kraj-poc))='\0';
- }
- else broj=0;
- }
- else s++;
- }
- }
- int main () {
- char s[]="U gradovima 8 i 9 temperatura je bila 23 stepena.";
- Izbaci(s, 10);
- printf("%s",s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement