مسائل C++ اتمني تساعدوني بأسرع وقت : (

    • مسائل C++ اتمني تساعدوني بأسرع وقت : (

      بسم الله الرحمن الرحيم

      عندي هالمسألتين ما عرفت حلهم لو سمحتي اذا تعرفون ما عليكم امر تعطوني طريقه الحل و بستخدام ال if , while , for statement $



      write program that prints all Fibonacci number that are lees than 30.000 . the first Fibonacci numbers are a . after those two , each Fibonacci number is the sum of the two number before it . the first 10 Fibonacci number are : 1,1,2,3,5,8,13,21,34,55





      ------------------------------------------------------------------------------

      write a program that reads a complete text line from the user and print it in a format similar to the one shown below ( which assumes the string "HEllo, World")


      هاذي المسأله اعتقد راح تدش فيها length , find اتوقع !!


      و يعطيكم العافيه مقدما ,,,,
    • السلام عليكم
      بعطيك جزء من حل السؤال الثاني وحاول فيه لتكمل الباقي وبشيك ع حلك
      #include
      <iostream>

      <string>

       

      using
      namespace std;

      int
      main()
      {
      int num;
      string str;
      cout<<
      "Please enter a sentence:";
      cin>>str;
      num =str.length();
      for( int i=0; i<=num ; i++)
      {
      int j=0;
      cout<<str.substr(j,i)<<endl;
      j++;
      }
       
       
       
       
       
      return 0;
      }