עבר עריכה לאחרונה בתאריך 14.05.03 בשעה 09:55
מכיוון שמותר להביא כמה חומר שאתה רוצה למבחן ...חשבתי שאולי תלמידי ה-C יצרפו לפה תוכניות מוקלדות שלהם בנושא מטריצות ומחרוזות כדי שלכולנו יהיה יותר קל ...
בשביל ההתחלה - ואני יוסיף עוד אם תביאו משלכם ..
// Asks for 10 Names, then printf the names that starts with the letter "r" . // // By eXyZed // /*--*/ #include <stdio.h> #include <conio.h> #include <string.h> #define N 10typedef char string{20}; void build_vec(string s{},int length); void print_vec(string s{}, int length); void names(string s{}, int length); void main() { string name{N}; clrscr(); flushall(); build_vec(name, N); print_vec(name,N); names(name, N); } void build_vec(string s{}, int length) { int i; for (i=0;i<length;i++) { printf("Enter name: "); gets(s{i}); printf("\n"); } } void names(string s{},int length) { int i; printf("the names start with r are:\n"); for (i=0;i<length;i++) { if (s{i}{0}=='r') puts(s{i}); } } void print_vec(string s{}, int length) { int i; printf(" the names are:\n"); for (i=0;i<length;i++) puts(s{i}); printf("\n"); }
|
לא לשכוח שאי אפשר לשים סוגריים מרובעים ..
אז להחליף אותם בסוגריים מסולסלים בבקשה.
הגלריה שלי : https://tomgelman.fotopic.net/
"כל פירור של מידע אנחנו נשלוף, מודיעין זהו קרב ללא סוף"