A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/premierconsult/public_html/index.php:65)

Filename: core/Input.php

Line Number: 408

A PHP Error was encountered

Severity: Warning

Message: session_start(): Cannot send session cookie - headers already sent by (output started at /home/premierconsult/public_html/index.php:65)

Filename: Session/Session.php

Line Number: 143

A PHP Error was encountered

Severity: Warning

Message: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/premierconsult/public_html/index.php:65)

Filename: Session/Session.php

Line Number: 143

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/premierconsult/public_html/index.php:65)

Filename: controllers/Questions.php

Line Number: 330

اكتب برنامج C لاستخراج كلمات من 3 إلى 6 أحرف من جملة مُعطاة لا تزيد عن 1024 حرفًا

اكتب برنامج C لاستخراج كلمات من 3 إلى 6 أحرف من جملة مُعطاة لا تزيد عن 1024 حرفًا


اكتب برنامج C لاستخراج كلمات من 3 إلى 6 أحرف من جملة مُعطاة لا تزيد عن 1024 حرفًا

الإدخال :

تتكون الجمل الإنجليزية من محددات وأحرف أبجدية رقمية في سطر واحد

مثال عن الخرج المتوقع :

 

English sentences consisting of delimiters and alphanumeric characters on one line:
daafoorsite.com

Extract words of 3 to 6 characters length from the said sentence:
com

الأجوبة

/*Write a C program to extract words of 3 to 6 characters length from a given sentence not more than 1024 characters*/

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main() {
  char input_text[1536];
  int ctr = 0;
  char * temp;
  printf("English sentences consisting of delimiters and alphanumeric characters on one line:\n");
  fgets(input_text, sizeof(input_text), stdin);
  printf("\nExtract words of 3 to 6 characters length from the said sentence:\n");
  for (temp = strtok(input_text, " .,\n"); temp != NULL; temp = strtok(NULL, " .,\n")) {
    const int len = strlen(temp);

    if (3 <= len && len <= 6) {
      if (ctr++) putchar(' ');
      fputs(temp, stdout);
    }
  }
  puts("");

  return (0);
}
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...