تبلیغات
دانلود سورس پروژه های مختلف برنامه نویسی، آموزش برنامه نویسی - پیدا کردن زیر رشته در سی
دانلود سورس پروژه های مختلف برنامه نویسی، آموزش برنامه نویسی
دانلود رایگان سورس پروژه
سایت برنامه نویسی تک کدر takcoder.ir


آموزش برنامه نویسی با استفاده از نوین ترین روش و ارائه پروژه های نمونه و مجموعه عظیم سورس کدهای آماده برای شما دوستان

مدیر سایت : Yahya Taherzadeh
نویسندگان
نظرسنجی
زبان برنامه نویسی مورد علاقه شما؟






برنامه در خواستی :دو رشته از ورودی بگیرد، رشته دوم را در رشته اول پیدا کرده و اندیس شروع را برگردد اگر چند تا بود اولی را برگردد ، اگر نبود1 -  برگردد.

 در مورد این برنامه باید بگم که مثل Find در ورد کار میکنه، یعنی حتی اگه داخل رشته اول و رشته دوم اسپیس باشه هم میتونه تشخیص بده.

  همین برنامه در سی پلاس پلاس

 تابع این برنامه موجود در کتابخانه زبان
#include <stdio.h>
#include <conio.h>

int main()
{
     char c1[99]={0}, c2[99]={0};
     int c, no=0,index=-1,i,j;

printf("Enter string 1:");
gets(c1);
printf("Enter string 2:");
gets(c2);

printf("s1:%s RRR\n",c1);
printf("s2:%s RRR\n",c2);
    for(j=0;c1[j]!='\0';j++)
{
i=j;
          for(c=0;;c++, i++)
          {
                if(c2[c+1]=='\0'&&c2[c]==c1[i])
                {
                     no++;
if(no==1 && index==-1)
index=j+1;
                     break;
                }
                else if(c2[c]==c1[i])
                     continue;
                else
                     break;

          }
 j=i;
}
printf("\nTekrar shode: %d time(s)!\n",no);
printf("shoroee index: %d\n",index);
getch();
return 0;
}





نوع مطلب : تیکه کد، پروژه های رایگان، سی| سی پلاس پلاس، آموزش، 
برچسب ها : زیر رشته در سی، آموزش زیر رشته ها، برنامه یافتن زیر رشته در یک رشته، برنامه یافتن زیر رشته در یک رشته در سی، زیر رشته و فاصله داخلش، یافتن فاصله در سی، ورود فاصله در سی،
لینک های مرتبط :
Yahya Taherzadeh
جمعه 22 آذر 1392
شنبه 19 آبان 1397 01:30 ب.ظ
Hi! I know this is kinda off topic nevertheless I'd figured I'd
ask. Would you be interested in trading links or maybe guest writing a blog
article or vice-versa? My blog addresses a lot of the same subjects
as yours and I feel we could greatly benefit from each other.
If you happen to be interested feel free to shoot me an e-mail.
I look forward to hearing from you! Wonderful blog by
the way!
جمعه 18 آبان 1397 02:32 ب.ظ
Thank you for the auspicious writeup. It in fact was a amusement account
it. Look advanced to more added agreeable from you!
However, how could we communicate?
جمعه 18 آبان 1397 05:09 ق.ظ
Aw, this was an extremely nice post. Finding the time and actual effort
to generate a top notch article… but what can I say… I procrastinate
a whole lot and don't seem to get nearly anything done.
دوشنبه 14 آبان 1397 06:39 ق.ظ
Quest bars cheap fitnesstipsnew1 quest bars cheap 516999410492780544 quest bars cheap
I am really happy to read this web site posts which carries plenty of
useful data, thanks for providing such information. Quest bars cheap fitnesstipsnew1 quest
bars cheap 516999410492780544 quest bars cheap
شنبه 12 آبان 1397 04:31 ب.ظ
continuously i used to read smaller content that also clear their
motive, and that is also happening with this piece of writing which I am reading at this place.
شنبه 5 آبان 1397 05:06 ب.ظ
What's up, all is going perfectly here and ofcourse every one is sharing facts, that's genuinely fine,
keep up writing.
جمعه 27 مهر 1397 01:09 ب.ظ
My developer is trying to persuade me to move to .net from PHP.

I have always disliked the idea because of the costs.

But he's tryiong none the less. I've been using WordPress on various websites
for about a year and am concerned about switching to another
platform. I have heard fantastic things about blogengine.net.

Is there a way I can import all my wordpress posts into it?
Any kind of help would be greatly appreciated!
یکشنبه 15 مهر 1397 09:28 ب.ظ
Wonderful items from you, man. I have take into accout your
stuff prior to and you are simply too wonderful.

I actually like what you've bought right here, certainly like what you are saying and the best way in which you assert it.
You're making it entertaining and you still take care of to keep
it sensible. I can not wait to read much more from
you. That is really a great site.
جمعه 13 مهر 1397 08:04 ب.ظ
Nice blog here! Also your site a lot up fast! What host are you the
usage of? Can I am getting your associate link to your host?
I desire my web site loaded up as fast as yours
lol
سه شنبه 10 مهر 1397 08:21 ق.ظ
It is perfect time to make some plans for the future and
it is time to be happy. I've read this post and if I could I desire to
suggest you some interesting things or suggestions. Maybe
you could write next articles referring to this article.
I wish to read even more things about it!
دوشنبه 9 مهر 1397 06:38 ب.ظ
It's an remarkable piece of writing in support of
all the internet users; they will take advantage from
it I am sure.
دوشنبه 9 مهر 1397 08:57 ق.ظ
Today, while I was at work, my cousin stole my iphone and tested to see if
it can survive a thirty foot drop, just so she can be a youtube
sensation. My iPad is now broken and she has 83 views.
I know this is totally off topic but I had to share it with someone!
یکشنبه 8 مهر 1397 01:04 ب.ظ
We're a group of volunteers and opening a new scheme in our community.
Your website provided us with helpful info to work on.
You have done an impressive job and our whole neighborhood will
be thankful to you.
جمعه 30 شهریور 1397 10:10 ق.ظ
I'd like to thank you for the efforts you have put in writing this blog.
I really hope to check out the same high-grade
content by you later on as well. In truth, your creative writing
abilities has motivated me to get my very own website now ;)
دوشنبه 26 شهریور 1397 07:56 ب.ظ
Fantastic post however I was wanting to know if you could write a litte more on this topic?
I'd be very thankful if you could elaborate a little bit further.
Appreciate it!
یکشنبه 18 شهریور 1397 07:15 ب.ظ
This article is truly a fastidious one it helps new
web people, who are wishing in favor of blogging.
چهارشنبه 12 اردیبهشت 1397 02:54 ق.ظ
Hi, its nice paragraph regarding media print, we all understand media is
a wonderful source of information.
شنبه 1 مهر 1396 10:05 ب.ظ
Good post however I was wanting to know if you could
write a litte more on this subject? I'd be very grateful if you could elaborate a little
bit further. Kudos!
یکشنبه 26 شهریور 1396 05:39 ب.ظ
I'm not sure exactly why but this web site is loading incredibly slow for
me. Is anyone else having this issue or is it a issue on my end?
I'll check back later on and see if the problem
still exists.
شنبه 14 مرداد 1396 08:34 ب.ظ
It's fantastic that you are getting thoughts from this piece of writing
as well as from our argument made at this time.
شنبه 14 مرداد 1396 11:26 ق.ظ
I am curious to find out what blog system you have been utilizing?
I'm experiencing some small security problems with my latest blog and I
would like to find something more safeguarded. Do you have any suggestions?
جمعه 6 مرداد 1396 06:11 ب.ظ
At this moment I am going away to do my breakfast, after
having my breakfast coming over again to read additional news.
یکشنبه 11 تیر 1396 09:37 ق.ظ
Glad to be one of many visitants on this amazing web site :
D.
دوشنبه 22 خرداد 1396 11:11 ق.ظ
You're so interesting! I do not suppose I've read something like that before.
So wonderful to find somebody with a few genuine thoughts on this subject
matter. Really.. thanks for starting this up.
This web site is something that is needed on the internet, someone with a bit of originality!
یکشنبه 17 اردیبهشت 1396 05:13 ق.ظ
What a material of un-ambiguity and preserveness of precious knowledge on the topic of unpredicted
emotions.
چهارشنبه 13 اردیبهشت 1396 02:46 ب.ظ
Thanks for sharing such a good idea, piece of writing is fastidious,
thats why i have read it entirely
جمعه 25 فروردین 1396 07:48 ب.ظ
After I initially commented I seem to have clicked the -Notify me when new comments are added-
checkbox and now every time a comment is added I get 4 emails with the exact
same comment. There has to be a means you are able to remove
me from that service? Many thanks!
جمعه 18 فروردین 1396 04:49 ب.ظ
Great article! This is the kind of info that are meant to be shared around the
internet. Shame on Google for now not positioning this put up upper!
Come on over and visit my site . Thank you =)
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر




صفحات جانبی
آمار وبلاگ
تاییدیه پرداخت
تبلیغات
به سایت تک کدر خوش آمدید