ΗΥ-150. Προγραμματισμός

Μέγεθος: px
Εμφάνιση ξεκινά από τη σελίδα:

Download "ΗΥ-150. Προγραμματισμός"

Transcript

1 ΗΥ-150 Αλφαριθμητικά (Strings)

2 Χαρακτήρες Αναπαριστώνται από έναν δυαδικό αριθμό 8 δυαδικών ψηφίων (8 bits) (256 διαφορετικές τιμές) Η κωδικοποίησή τους έχει τυποποιηθεί με τον κώδικα ASCII Εκτός από γράμματα και ψηφία υπάρχουν και πολλοί ειδικοί χαρακτήρες Σταθερές χαρακτήρων Η έκφραση 'z' είναι μια σταθερά και αντιστοιχεί σε έναν int με τα 8 τελευταία του bits ίσα με τον ASCII κωδικό του χαρακτήρα 'z, \t, \n, κτλ

3 Βασικά για τα Αλφαριθμητικά (strings) Μια σειρά από χαρακτήρες που αντιμετωπίζονται σαν ένα αντικείμενο Γράμματα, αριθμοί, ειδικοί χαρακτήρες (*, /, $) και όλοι οι εκτυπώσιμοι χαρακτήρες Τιμές εισάγονται μέσα σε διπλά εισαγωγικά "Hello" Τα Strings είναι πάντα πίνακες από χαρακτήρες Ένα String είναι δείκτης στον 1 ο χαρακτήρα του πίνακα Τιμή του string είναι η διεύθυνση του 1 ου χαρακτήρα του πίνακα

4 char vs. C string A data type char and is stored in 1 byte 5000 A A is a C string of 1 character and is stored in 2 bytes 6000 A 6001 \0

5 Διαφορά μεταξύ'a' και "A". Το πρώτο είναι ο, ένας, χαρακτήρας A και το δεύτερο είναι το string A. Αφού τα strings είναι null-terminated, το "A" χρησιμοποιεί 2 χαρακτήρες το 'A' και το'\0'. Το "Hello" χρησιμοποιεί 6 χαρακτήρες, 'H', 'e', 'l', 'l', 'o', and '\0'. Έστω η δήλωση: char name[16]; Αφού τα C/C++ strings είναι null-terminated και ο name έχει 16 χαρακτήρες,, το μεγαλύτερο string που μπορεί να αποθηκευθεί στον name είναι ένα 15 χαρακτήρων. Εάν αποθηκεύσουμε ένα string 10 χαρακτήρων στον name, τότε μόνο τα πρώτα 11 στοιχεία του είναι σε χρήση, ενώ τα υπόλοιπα 5 όχι.

6 char message[8]; // declaration allocates memory Για το μεταφραστή, η τιμή του message είναι η διεύθυνση της αρχής του πίνακα H e l l o \0 message [0] [1] [2] [3] [4] [5] [6] [7]

7 Character Arrays char pmessage[] = "now is the time"; /* an array */ char *amessage = "now is the time"; /* a pointer */

8 Δηλώσεις Δηλώσεις αλφαριθμητικών Σαν πίνακας από χαρακτήρες ή σαν δείκτης σε χαρακτήρα char * char color[] = "blue"; char *colorptr = "blue"; Κάθε string τελειώνει με '\0' και πρέπει να το λαμβάνουμε υπόψη στη δήλωση του πίνακα color has 5 elements

9 string[0] = J string[1] = I string[2] = b string[3] = r string[4] = a string[5] = n string[6] = string[7] = B string[8] = h string[9] = a string[10] = t string[11] = \0

10 Ανάγνωση Διάβασμα strings Χρήση cin cin >>word; Αντιγράφει στο word[] Προσθέτει το '\0' Αφήνουμε χώρο στον πίνακα και για το '\0'

11 String variables string first; first = "Hello, "; string second = "world."; cout << first << second << endl;

12 Extracting characters from a string string fruit = "banana"; char letter = fruit[1]; cout << letter << endl; char letter = fruit[0];

13 Length int length; length = fruit.length(); int length = fruit.length(); char last = fruit[length]; // WRONG!! int length = fruit.length(); char last = fruit[length-1];

14 Traversal 1 int index = 0; while (index < fruit.length()) { char letter = fruit[index]; cout << letter << endl; index = index + 1; }

15 Traversal 2 for (int index=0; index< fruit.length();index++) { char letter = fruit[index]; cout << letter << endl; }

16 The find function Searches the string for the content and returns the position of the first occurrence in the string. string fruit = "banana"; int index = fruit.find( a ); string fruit = "banana"; int index = fruit.find("nan"); This example returns the value 2.

17 1 2 3 #include <iostream> 4 5 int main() 6 { 7 char string1[ 20 ], string2[] = "string literal"; 8 int i; 9 10 cout << " Enter a string: "; 11 cin >> string1 ; 12 cout <<"string1 is: <<string1<<endl<<string2: is <<string2; 13 cout <<"string1 with spaces between characters is: << endl; for ( i = 0; string1[ i ]!= '\0'; i++ ) 17 cout << string1[ i ] << ; cout << endl; 20 return 0; 21 } Enter a string: Hello there string1 is: Hello string2 is: string literal string1 with spaces between characters is: H e l l o

18 Πρόβλημα : Εκτυπώστε ανάστροφα το κείμενο που θα διαβαστεί από την οθόνη. #define N 100 void inversion(string s) { int i; for (i = s.length()-1; i >= 0; --i) cout << s[i]; } cout << endl; int main() { string s; cout << "Dwste mia le3h mexri << N << xarakthres < < endl; cin >> s; inversion(s); } return 0;

19 Ορισμός Strings Παραδείγματα: hello, high school, H2O. Συνηθισμένες «πράξεις» με strings: Παράθεση: high + school = highschool Σύγκριση: high < school // alphabetical

20 Χρήσιμες Συναρτήσεις (string.h) int strlen( const char *s ); Επιστρέφει τον αριθμό των χαρακτήρων πριν το \0 που βρίσκονται στο s (το μήκος string) char *strdup(const char *s1); Δεσμεύει όση μνήμη χρειάζεται και αντιγράφει σε αυτήν το αλφαριθμητικό στο s1. Επιστρέφει την καινούργια μνήμη με το καινούργιο αντίγραφο του s1. Η δεσμευμένη μνήμη χρειάζεται να αποδεσμευτεί στο τέλος με την free.

21 strlen /* strlen: return length of string s */ int strlen(char *s) { int n; for (n = 0; s[n]!= '\0'; n++) ; return n; }

22 strlen /* strlen: return length of string s */ int strlen(char *s) { char *p = s; while (*p!= '\0') p++; return p s; }

23 strlen /* strlen: return length of string s */ int strlen(char *s) { int n; for (n = 0; *s!= '\0', s++) n++; return n; }

24 strcpy /* strcpy: copy t to s; array subscript version */ void strcpy(char *s, char *t) { int i; i = 0; while ((s[i] = t[i])!= '\0') i++; }

25 strcpy /* strcpy: copy t to s; pointer version */ void strcpy(char *s, char *t) { while ((*s = *t)!= '\0') { s++; t++; } }

26 Συναρτήσεις σύγκρισης (string.h) Σύγκριση αλφαριθμητικών Συγκρίνονται οι ASCII κώδικες των χαρακτήρων int strcmp( const char *s1, const char *s2 ); Συγκρίνει το s1 με το s2 Επιστρέφει: αρνητικό αριθμό αν s1 < s2, μηδέν αν s1 == s2, ή θετικό αν s1 > s2

27 Συναρτήσεις σύγκρισης (string.h) Σύγκριση αλφαριθμητικών Συγκρίνονται οι ASCII κώδικες των χαρακτήρων int strcmp( const char *s1, const char *s2 ); Συγκρίνει το s1 με το s2 Επιστρέφει: αρνητικό αριθμό αν s1 < s2, μηδέν αν s1 == s2, ή θετικό αν s1 > s2 Αλφαριθμητική σειρά, με βάση το ASCII. Κάθε ψηφίο/χαραρακτήρας του string είναι ένα ψηφίο του αριθμού/αλφαρηθμητικού στο 256-δικό σύστημα.

28 strcmp /* strcmp: return <0 if s<t, 0 if s==t, >0 if s>t */ int strcmp(char *s, char *t) { int i; for (i = 0; s[i] == t[i]; i++) if (s[i] == '\0') return 0; return s[i] t[i]; }

29 strcmp /* strcmp: return <0 if s<t, 0 if s==t, >0 if s>t */ int strcmp(char *s, char *t) { for ( ; *s == *t; s++, t++) if (*s == '\0') return 0; return *s *t; }

30 char myname [ 21 ] = Huang ; char yourname [ 21 ] ; if ( myname == yourname ) // compares addresses only! { // That is, 4000 and 6000 here. }. // DOES NOT COMPARE CONTENTS! myname [0] H u a n g \ yourname [0] H e a d i n g t o n \0...

31 char myname [ 21 ] = Huang ; char yourname [ 21 ] ; strcpy ( yourname, myname ) ; // changes string yourname // OVERWRITES CONTENTS! 4000 myname [0] H u a n g \0... yourname [0] 6000 u n g \0 H e a d i n g t o n \0...

32 The string Class in C++ C++ has a <string> library Include it in your programs when you wish to use strings: #include <string> In this library, a class string is defined and implemented

33 Declaration of strings The following instructions are all equivalent. They declare x to be an object of type string, and assign the string high school to it: string x( high school ); string x= high school ; string x; x= high school ;

34 Operations on strings (Concatenation) Let x and y be two strings To concatenate x and y, write: x+y string x= high ; string y= school ; string z; z=x+y; cout<< z= <<z<<endl; z =z+ was fun ; cout<< z= <<z<<endl; Output: z=highschool z= highschool was fun

35 Concatenation of Mixed-Style Strings In s=u+v+w; u can be A string object, or where s is of type string, a C-style string (a char array or a char pointer), a C-style char or a double-quoted string, or a single-quoted character. Same with v and w. At least u or v or w must be a string object

36 Παράδειγμα string x= high ; char y[]= school ; char z[]= { w, a, s, \0 }; char *p = good ; string s= x+y+ +z+ very + +p+! ; cout<< s= <<s<<endl; cout<< s= +s<<endl; Output: s=highschool was very good! s=highschool was very good!

37 The concat-assign Operator += Assume x is a string object. The statement x += y; is equivalent to x=x+y; where y can be a string object, a C-style string variable, a char variable, a double-quoted string, or a single-quoted char.

38 Comparison Operators for string Objects We can compare two strings x and y using the following operators: ==,!=, <, <=, >, >= The comparison is alphabetical (ASCII) The outcome of each comparison is: true or false The comparison works as long as at least x or y is a string object. The other string can be a string object, a C-style string variable, or a double-quoted string.

39 Example of String Comparisons string x= high ; char y[]= school ; char *p = good ; if (x<y) cout<< x<y <<endl; if (x< tree ) cout<< x<tree <,endl; if ( low!= x) cout<< low!= x <<endl; if( (p>x) cout<< p>x <<endl; else cout<< p<=x <<endl; Output: x<y x<tree low!= x p>x

40 The Index Operator [] If x is a string object, and you wish to obtain the value of the k-th character in the string, you write: x[k]; This feature makes string objects string x= appear high ; like arrays of chars. char c=x[0]; // c is h c=x[1]; // c is i c=x[2]; // c is g

41 Getting a string Object Length & Checking for Emptiness To obtain the length of a string object x, call the method length() or size(): int len=x.length( ); --or-- int len=x.size( ); To check of x is empty (that is, has no characters in it): bool x.empty();

42 Obtaining Substrings of Strings Logically, a substring of a string x is a subsequence of consecutive characters in x For example, rod is a substring of product If x is a string object, and we want the substring that begins at position pos and has len characters (where pos and len are of type int), write: string y = x.substr(pos,len); The default value of len is x.length( ) string y = x.substr(pos);//x[pos..end-1] The default value for pos is 0

43 Inserting a String Inside Another Suppose x is a string object, and let y be another string to be inserted at position pos of the string of x To insert y, do: The argument y can be: a string object, a C-style string variable, or a double-quoted string x.insert(pos,y);

44 Replacing a Substring by Another Suppose x is a string object, and suppose you want to replace the characters in the range [pos,pos+len) in x by a string y. To do so, write: The argument y can be: a string object, a C-style string variable, or a double-quoted string x.replace(pos,len,y);

45 Deleting (Erasing) a Substring of a string Object Suppose x is a string object, and suppose you want to delete/erase the characters in the range [pos,pos+len) in x. To do so, write: The default value of len is the x.length( ) x.erase(pos,len); The default value for pos is 0 To erase the whole string of x, do: x.erase(pos); // erases x[pos..end-1] x.clear( );

46 Searching for (and Finding) Patterns in Strings Suppose x is a string object, and suppose you want to search for a string y in x. To do so, write: int startloc = x.find(y); This method returns the starting index of the leftmost occurrence of y in x, if any occurrence exits; otherwise, the method returns the length of x. To search starting from a position pos, do int startloc = x.find(y, pos);

47 Searching for Patterns (Contd.) In all the versions of find and rfind, the argument y can be a string object, a C-style string variable, double-quoted string, a char variable, or a singlequoted char. startloc = x.rfind(y); // or startloc = x.rfind(y, pos);

48 An Example string x= ; int colonpos=x.find( : ); string prefix=x.substr(0,colonpos); //=FROM string suffix = x. substr(colonpos+1); cout<< -This message is from <<suffix<<endl; Output: -This message is from ayoussef@gwu.edu

49 Trimming Leading & Trailing Spaces // this function removes leading and trailing spaces from x void trim (string& x){ int k = 0; // k will procced to the first non-blank char while(k<x.size() &&(x[k]==' ' x[k]=='\t' x[k]=='\n')) k++; x.erase(0,k); } int s=x.size(); // s will move backward to the rightmost non-blank char while(s>0 &&(x[s-1]==' ' x[s-1]=='\t' x[s-1]=='\n')) s--; x.erase(s);

50 Correspondence between the C library and the C++ string Class C Library Functions C++ string operators/methods strcpy strcat = (the assignment operator) += (assign+concat operator) strcmp = =,!=, <, >, <=, >= strchr, strstr strrchr.find( ) method.rfind( ) method strlen.size( ) or.length( ) methods

51 Char Functions in C (and C++) The <ctype.h> library in C provides useful functions for single char variables The next slide gives the most common char functions. Although the input argument appears to be of type int, it is actually a char.

52 Διαχείριση Αλφαριθμητικών Βρίσκονται στο <stdlib.h> Μετατρέπουν αλφαριθμητικά (αν είναι κατάλληλα) σε αριθμητικές τιμές Prototype double atof( const char *nptr ) int atoi( const char *nptr ) long atol( const char *nptr ) Description Converts the string nptr to double. Converts the string nptr to int. Converts the string nptr to long int.

53 Συναρτήσεις Ανάγνωσης και Εκτύπωσης (C) Βρίσκονται στο <stdio.h> int sprintf(char *s, const char *format, ) Ισοδύναμη με την printf μόνο που η έξοδος είναι στο string s και όχι στην οθόνη int sscanf(char *s, const char *format, ) Ισοδύναμη με την scanf μόνο που η είσοδος είναι από το string s και όχι από το πληκτρολόγιο char s[100]; char f[] = " "; float t1,t2,t3; sprintf(s,"%s",f); sscanf(s,"%f %f %f",&t1,&t2,&t3); printf("s = %s\nt1 = %f t2 = %f t3 = %f\n",s,t1,t2,t3);

54 String literals Evaluating dog results in memory allocated for three characters d, o, g, plus terminating NUL char *m = dog ; Note: If m is an array name, subtle difference: char m[10] = dog ; 10 bytes are allocated for this array This is not a string literal; It s an array initializer in disguise! Equivalent to { d, o, g, \0 }

55 String manipulation functions Read some source string(s), possibly write to some destination location char *strcpy(char *dst, char const *src); char *strcat (char *dst, char const *src); Programmer s responsibility to ensure that: destination region large enough to hold result source, destination regions don t overlap undefined behavior in this case according to C spec, anything could happen! Assuming that the implementation of strcpy char m[10] = dog ; starts copying left-to-right without checking for the presence of a terminating NUL first, what will strcpy(m+1, m); happen?

56 strlen() and size_t size_t strlen(char const *string); /* returns length of string */ size_t is an unsigned integer type, used to define sizes of strings and (other) memory blocks Reasonable to think of size as unsigned... But beware! Expressions involving strlen() may be unsigned (perhaps unexpectedly) if (strlen(x) strlen(y) >= 0)... avoid by casting: always true! ((int) (strlen(x) strlen(y)) >= 0) Problem: what if x or y is a very large string? a better alternative: (strlen(x) >= strlen(y))

57 strcmp() string comparison int strcmp(char const *s1, char const *s2); returns a value less than zero if s1 precedes s2 in lexicographical order; returns zero if s1 and s2 are equal; returns a value greater than zero if s1 follows s2. Source of a common mistake: seems reasonable to assume that strcmp returns true (nonzero) if s1 and s2 are equal; false (zero) otherwise In fact, exactly the opposite is the case!

58 Restricted vs. unrestricted string functions Restricted versions: require an extra integer argument that bounds the operation char *strncpy(char *dst, char const *src, size_t len); char *strncat(char *dst, char const *src, size_t len); int strncmp(char const *s1, char const *s2, size_t len); safer in that they avoid problems with missing NUL terminators safety concern with strncpy: If bound isn t large enough, terminating NUL won t be written Safe alternative: strncpy(buffer, name, BSIZE); buffer[bsize-1] = \0 ; - SUBSTRINGS

59 String searching char *strpbrk(char const *str, char const *group); /* return a pointer to the first character in str that matches *any* character in group; return NULL if there is no match */ size_t *strspn(char const *str, char const *group); /* return number of characters at beginning of str that match *any* character in group */ Ο pointer δείχνει «μέσα» στο αλφαρηθμητικό. Χρειαζόμαστε ωστόσο να, θυμόμαστε, με άλλο pointer, και την αρχή του αλφαρηθμητικού.

60 strtok string tokenizer char *strtok(char *s, char const *delim); /* delim contains all possible tokens : characters that separate tokens. if delim non-null: return ptr to beginning of first token in s, and terminate token with NUL. if delim is NULL: use remainder of untokenized string from the last call to strtok */

61 strtok in action for ( token = strtok(line, whitespace); token!= NULL; token = strtok(null, whitespace)) printf( Next token is %s\n, token); d o g NUL c a t NUL NUL line NUL token

62 An implementation of strtok char* strtok(char *s, const char *delim) { static char *old = NULL; old contains the remains of an earlier s value char *token; (note use of static) if (! s) { s = old; if (! s) return NULL; } } if (s) { NULL has been passed in for s, s += strspn(s, delim); so consult old if (*s == 0) { old = NULL; return NULL; } } token = s; s = strpbrk(s, delim); if (s == NULL) old = NULL; else { *s = 0; old = s + 1; } return token; strspn returns number of delimiters at beginning of s skip past these characters strpbrk gives the position of the next delimiter. s is updated to this position, but token still points to the token to return.

63 main( ) { char name1[12],name2[12],mixed[25]; char title[20]; strcpy(name1,"rosalinda"); strcpy(name2,"zeke"); strcpy(title,"this is the title."); printf(" %s\n\n"title); printf("name 1 is %s\n",name1); printf(name 2 is %s\n",name2); if (strcmp(name1,name2)>0) /* return 1 if name1 > name2 */ strcpy(mixed,name1); else strcpy(mixed,name2); printf("the biggest name alphabetically is %s\n",mixed); strcpy(mixed,name1); strcat(mixed," "); strcat(mixed,name2); printf("both names are %s\n",mixed); }

64 Array of strings

65 The strchr function char *strchr(const char *s, int c); The strchr() function shall locate the first occurrence of c (converted to a char) in the string pointed to by s. The terminating null byte is considered to be part of the string. The function returns the location of the found character, or a null pointer if the character was not found. #include <string.h> /* strchr */ char *(strchr)(const char *s, int c) { /* Scan s for the character. When this loop is finished, s will either point to the end of the string or the character we were looking for. */ } while (*s!= '\0' && *s!= (char)c) s++; return ( (*s == c)? (char *) s : NULL );

66 The strstr function char *strstr(const char *haystack, const char *needle); The strstr() function shall locate the first occurrence in the string pointed to by haystack of the sequence of bytes (excluding the terminating null byte) in the string pointed to by needle. The function returns the pointer to the matching string in haystack or a null pointer if a match is not found. If needle is an empty string, the function returns haystack. #include <string.h> /* strstr */ char *(strstr)(const char *haystack, const char *needle) { size_t needlelen; /* Check for the null needle case. */ if (*needle = = '\0') return (char *) haystack; needlelen = strlen(needle); for (; (haystack = strchr(haystack, *needle))!= NULL; haystack++) if (strncmp(haystack, needle, needlelen) == 0) return (char *) haystack; return NULL; }

ΗΥ-150. Προγραμματισμός

ΗΥ-150. Προγραμματισμός ΗΥ-150 Αλφαριθμητικά (Strings) Χαρακτήρες Αναπαριστώνται από έναν δυαδικό αριθμό 8 δυαδικών ψηφίων (8 bits) (256 διαφορετικές τιμές) Η κωδικοποίησή τους έχει τυποποιηθεί με τον κώδικα ASCII Εκτός από γράμματα

Διαβάστε περισσότερα

ΗΥ-150. Προγραµµατισµός. Αλφαριθµητικά (Strings)

ΗΥ-150. Προγραµµατισµός. Αλφαριθµητικά (Strings) ΗΥ-150 Προγραµµατισµός Αλφαριθµητικά (Strings) Προγραµµατισµός Standard library accessed by #include #include Προγραµµατισµός 2 Χαρακτήρες Αναπαριστώνται από έναν δυαδικό αριθµό

Διαβάστε περισσότερα

ΗΥ-150 Προγραμματισμός Αλυαριθμητικά (Strings)

ΗΥ-150 Προγραμματισμός Αλυαριθμητικά (Strings) ΗΥ-150 Προγραμματισμός Αλυαριθμητικά (Strings) Χαξαθηήξεο Αλαπαξηζηώληαη από έλαλ δπαδηθό αξηζκό 8 δπαδηθώλ ςεθίσλ (8 bits) (256 δηαθνξεηηθέο ηηκέο) Η θσδηθνπνίεζή ηνπο έρεη ηππνπνηεζεί κε ηνλ θώδηθα ASCII

Διαβάστε περισσότερα

Διάλεξη 8η: Αλφαριθμητικά (strings)

Διάλεξη 8η: Αλφαριθμητικά (strings) Διάλεξη 8η: Αλφαριθμητικά (strings) Τμήμα Επιστήμης Υπολογιστών, Πανεπιστήμιο Κρήτης Εισαγωγή στην Επιστήμη Υπολογιστών Βασίζεται σε διαφάνειες του Κ Παναγιωτάκη Πρατικάκης (CSD) strings CS100, 2016-2017

Διαβάστε περισσότερα

HY150a Φροντιστήριο 3 24/11/2017

HY150a Φροντιστήριο 3 24/11/2017 HY150a Φροντιστήριο 3 24/11/2017 1 Assignment 3 Overview Το πρόγραμμα ζητείται να διαβάζει μια λίστα δεδομένων που περιγράφει τα διαθέσιμα τμήματα μνήμης (blocks) ενός ΗΥ. Το πρόγραμμα ζητείται να μεταφορτώνει

Διαβάστε περισσότερα

Συµβολοσειρές - Strings

Συµβολοσειρές - Strings Συµβολοσειρές - Strings 1 Συµβολοσειρέςστην C/C++ 2 Χαρακτήρες 'a', 'z', '0', Χαρακτήρες σαν int 'z' επίσης αναπαριστά την ακεραία τιµή του χαρακτήρα z Strings-Συµβολοσειρές Σειρές από χαρακτήρες σαν µια

Διαβάστε περισσότερα

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής Να γραφεί πρόγραμμα το οποίο δέχεται ως είσοδο μια ακολουθία S από n (n 40) ακέραιους αριθμούς και επιστρέφει ως έξοδο δύο ακολουθίες από θετικούς ακέραιους

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011 Διάρκεια Διαγωνισμού: 3 ώρες Απαντήστε όλες τις ερωτήσεις Μέγιστο Βάρος (20 Μονάδες) Δίνεται ένα σύνολο από N σφαιρίδια τα οποία δεν έχουν όλα το ίδιο βάρος μεταξύ τους και ένα κουτί που αντέχει μέχρι

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Αν κάπου κάνετε κάποιες υποθέσεις να αναφερθούν στη σχετική ερώτηση. Όλα τα αρχεία που αναφέρονται στα προβλήματα βρίσκονται στον ίδιο φάκελο με το εκτελέσιμο

Διαβάστε περισσότερα

2 Composition. Invertible Mappings

2 Composition. Invertible Mappings Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Composition. Invertible Mappings In this section we discuss two procedures for creating new mappings from old ones, namely,

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα είναι μικρότεροι το 1000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Διάρκεια: 3,5 ώρες Καλή

Διαβάστε περισσότερα

Κεφάλαιο Αλφαριθμητικές Σειρές Χαρακτήρων (Strings) (Διάλεξη 20) 1) Strings στη C

Κεφάλαιο Αλφαριθμητικές Σειρές Χαρακτήρων (Strings) (Διάλεξη 20) 1) Strings στη C Κεφάλαιο 9.1-9.2 Αλφαριθμητικές Σειρές Χαρακτήρων (Strings) (Διάλεξη 20) 1) Strings στη C Ένα string είναι μία ακολουθία αλφαριθμητικών χαρακτήρων, σημείων στίξης κτλ. Π.χ. Hello How are you? 121212 *Apple#123*%

Διαβάστε περισσότερα

Συναρτήσεις διαχείρισης αλφαριθμητικών

Συναρτήσεις διαχείρισης αλφαριθμητικών Συναρτήσεις διαχείρισης αλφαριθμητικών Όνομα βιβλιοθήκης: string.h Ενδεικτικές συναρτήσεις: char *strcpy(char *s1, char *s2): Αντιγράφει την ακολουθία χαρακτήρων s2 στον πίνακα s1. Επιστρέφεται η τιμή

Διαβάστε περισσότερα

C.S. 430 Assignment 6, Sample Solutions

C.S. 430 Assignment 6, Sample Solutions C.S. 430 Assignment 6, Sample Solutions Paul Liu November 15, 2007 Note that these are sample solutions only; in many cases there were many acceptable answers. 1 Reynolds Problem 10.1 1.1 Normal-order

Διαβάστε περισσότερα

The Simply Typed Lambda Calculus

The Simply Typed Lambda Calculus Type Inference Instead of writing type annotations, can we use an algorithm to infer what the type annotations should be? That depends on the type system. For simple type systems the answer is yes, and

Διαβάστε περισσότερα

Διδάσκων: Κωνσταντίνος Κώστα Διαφάνειες: Δημήτρης Ζεϊναλιπούρ

Διδάσκων: Κωνσταντίνος Κώστα Διαφάνειες: Δημήτρης Ζεϊναλιπούρ Διάλεξη 2:Αλφαριθμητικές Σειρές Χαρακτήρων (Strings)- Επανάληψη Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: Εισαγωγικές Έννοιες σε Strings(Αρχικοποίηση, Ανάγνωση & Εκτύπωση) Πίνακες από Strings

Διαβάστε περισσότερα

ΑΡΧΕΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΥ

ΑΡΧΕΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΥ ΑΡΧΕΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΥ Κεφάλαιο 8 Επιμέλεια: Βασίλης Παλιουράς, Αναπληρωτής Καθηγητής Ευάγγελος Δερματάς, Αναπληρωτής Καθηγητής Σταύρος Νούσιας, Βοηθός Ερευνητή Πολυτεχνική Σχολή Τμήμα Ηλεκτρολόγων Μηχανικών

Διαβάστε περισσότερα

Διαδικασιακός Προγραμματισμός

Διαδικασιακός Προγραμματισμός Τμήμα ΜΗΧΑΝΙΚΩΝ ΠΛΗΡΟΦΟΡΙΚΗΣ ΤΕ ΤΕΙ ΔΥΤΙΚΗΣ ΕΛΛΑΔΑΣ Διαδικασιακός Προγραμματισμός Διάλεξη 10 η Αλφαριθμητικά Οι διαλέξεις βασίζονται στο βιβλίο των Τσελίκη και Τσελίκα C: Από τη Θεωρία στην Εφαρμογή Σωτήρης

Διαβάστε περισσότερα

Χpήσιµες Βιβλιοθήκες της γλώσσας C

Χpήσιµες Βιβλιοθήκες της γλώσσας C Χpήσιµες Βιβλιοθήκες της γλώσσας C Στην ενότητα αυτή θα µελετηθούν τα εξής επιµέρους θέµατα: Συναρτήσεις Επεξεργασίας Συµβολοσειρών (strings) που Παρέχονται από τη Βιβλιοθήκη Συναρτήσεις Ελέγχου

Διαβάστε περισσότερα

A ΜΕΡΟΣ. 1 program Puppy_Dog; 2 3 begin 4 end. 5 6 { Result of execution 7 8 (There is no output from this program ) 9 10 }

A ΜΕΡΟΣ. 1 program Puppy_Dog; 2 3 begin 4 end. 5 6 { Result of execution 7 8 (There is no output from this program ) 9 10 } A ΜΕΡΟΣ 1 program Puppy_Dog; begin 4 end. 5 6 { Result of execution 7 (There is no output from this program ) 10 } (* Κεφάλαιο - Πρόγραµµα EX0_.pas *) 1 program Kitty_Cat; begin 4 Writeln('This program');

Διαβάστε περισσότερα

ΕΙΣΑΓΩΓΗ ΣΤΟΝ ΔΟΜΗΜΕΝΟ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ

ΕΙΣΑΓΩΓΗ ΣΤΟΝ ΔΟΜΗΜΕΝΟ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ Πανεπιστήμιο Δυτικής Μακεδονίας Τμήμα Μηχανικών Πληροφορικής και Τηλεπικοινωνιών ΕΙΣΑΓΩΓΗ ΣΤΟΝ ΔΟΜΗΜΕΝΟ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ Αλφαριθμητικά Αλφαριθμητικά (strings) Ένα αλφαριθμητικό είναι μια ακολουθία αλφαβητικών

Διαβάστε περισσότερα

Homework 3 Solutions

Homework 3 Solutions Homework 3 Solutions Igor Yanovsky (Math 151A TA) Problem 1: Compute the absolute error and relative error in approximations of p by p. (Use calculator!) a) p π, p 22/7; b) p π, p 3.141. Solution: For

Διαβάστε περισσότερα

(C) 2010 Pearson Education, Inc. All rights reserved.

(C) 2010 Pearson Education, Inc. All rights reserved. Connectionless transmission with datagrams. Connection-oriented transmission is like the telephone system You dial and are given a connection to the telephone of fthe person with whom you wish to communicate.

Διαβάστε περισσότερα

Προαπαιτούμενες Ασκήσεις 5 ου Εργαστηρίου. Dose stoixeio (integer) : 25 Found stoixeio in position 7 Dose stoixeio (integer) :94 Value not found

Προαπαιτούμενες Ασκήσεις 5 ου Εργαστηρίου. Dose stoixeio (integer) : 25 Found stoixeio in position 7 Dose stoixeio (integer) :94 Value not found Α. Πρώτη προαπαιτούµενη Κάθε οµάδα θα πρέπει να δηµιουργήσει τον ζητούµενο παρακάτω πίνακα και α. να εµφανίσει τα στοιχεία του, β. να τυπώσει τον µέσο όρο των στοιχείων του, γ. να ταξινοµήσει τα στοιχεία

Διαβάστε περισσότερα

Section 8.3 Trigonometric Equations

Section 8.3 Trigonometric Equations 99 Section 8. Trigonometric Equations Objective 1: Solve Equations Involving One Trigonometric Function. In this section and the next, we will exple how to solving equations involving trigonometric functions.

Διαβάστε περισσότερα

Προγραμματισμός Η/Υ (ΤΛ2007 )

Προγραμματισμός Η/Υ (ΤΛ2007 ) Τμήμα Ηλεκτρονικών Μηχανικών Τ.Ε.Ι. Κρήτης Προγραμματισμός Η/Υ (ΤΛ2007 ) Δρ. Μηχ. Νικόλαος Πετράκης (npet@chania.teicrete.gr) Ιστοσελίδα Μαθήματος: https://eclass.chania.teicrete.gr/ Εξάμηνο: Εαρινό 2015-16

Διαβάστε περισσότερα

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS CHAPTER 5 SOLVING EQUATIONS BY ITERATIVE METHODS EXERCISE 104 Page 8 1. Find the positive root of the equation x + 3x 5 = 0, correct to 3 significant figures, using the method of bisection. Let f(x) =

Διαβάστε περισσότερα

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/ Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/ Συνάρτηση round() Περιγραφή Η συνάρτηση ROUND στρογγυλοποιεί έναν αριθμό στον δεδομένο

Διαβάστε περισσότερα

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω 0 1 2 3 4 5 6 ω ω + 1 ω + 2 ω + 3 ω + 4 ω2 ω2 + 1 ω2 + 2 ω2 + 3 ω3 ω3 + 1 ω3 + 2 ω4 ω4 + 1 ω5 ω 2 ω 2 + 1 ω 2 + 2 ω 2 + ω ω 2 + ω + 1 ω 2 + ω2 ω 2 2 ω 2 2 + 1 ω 2 2 + ω ω 2 3 ω 3 ω 3 + 1 ω 3 + ω ω 3 +

Διαβάστε περισσότερα

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible. B-Trees Index files can become quite large for large main files Indices on index files are possible 3 rd -level index 2 nd -level index 1 st -level index Main file 1 The 1 st -level index consists of pairs

Διαβάστε περισσότερα

Εντολές εισόδου - εξόδου. Εισαγωγή στη C++

Εντολές εισόδου - εξόδου. Εισαγωγή στη C++ Εντολές εισόδου - εξόδου Εισαγωγή στη C++ Το πρώτο πρόγραμμα //my first program #include using namespace std; int main(){ cout

Διαβάστε περισσότερα

ΑΣΚΗΣΗ 7: ΑΛΦΑΡΙΘΜΗΤΙΚΑ

ΑΣΚΗΣΗ 7: ΑΛΦΑΡΙΘΜΗΤΙΚΑ ΑΣΚΗΣΗ 7: ΑΛΦΑΡΙΘΜΗΤΙΚΑ Σκοπός της Άσκησης Ο σκοπός αυτής της εργαστηριακής άσκησης είναι η εξοικείωση με τον ορισμό, τη δήλωση και τη χρήση των χαρακτήρων, συνεπώς και των αλφαριθμητικών, της Γλώσσας

Διαβάστε περισσότερα

Προγραμματισμός Η/Υ (ΤΛ2007 )

Προγραμματισμός Η/Υ (ΤΛ2007 ) Τμήμα Ηλεκτρονικών Μηχανικών Τ.Ε.Ι. Κρήτης Προγραμματισμός Η/Υ (ΤΛ2007 ) Δρ. Μηχ. Νικόλαος Πετράκης (npet@chania.teicrete.gr) Ιστοσελίδα Μαθήματος: https://eclass.chania.teicrete.gr/ Εξάμηνο: Εαρινό 2014-15

Διαβάστε περισσότερα

Example Sheet 3 Solutions

Example Sheet 3 Solutions Example Sheet 3 Solutions. i Regular Sturm-Liouville. ii Singular Sturm-Liouville mixed boundary conditions. iii Not Sturm-Liouville ODE is not in Sturm-Liouville form. iv Regular Sturm-Liouville note

Διαβάστε περισσότερα

Μεθόδων Επίλυσης Προβλημάτων

Μεθόδων Επίλυσης Προβλημάτων ΕΠΛ 032.3: 3: Προγραμματισμός Μεθόδων Επίλυσης Προβλημάτων Αχιλλέας Αχιλλέως, Τμήμα Πληροφορικής, Πανεπιστήμιο Κύπρου Email: achilleas@cs.ucy.ac.cy Κεφάλαιο 14 Αλφαριθμητικές Σειρές Χαρακτήρων (Strings)

Διαβάστε περισσότερα

Συμβολοσειρές ΣΥΜΒΟΛΟΣΕΙΡΕΣ. Γεώργιος Παπαϊωάννου ( )

Συμβολοσειρές ΣΥΜΒΟΛΟΣΕΙΡΕΣ. Γεώργιος Παπαϊωάννου ( ) ΣΥΜΒΟΛΟΣΕΙΡΕΣ Γεώργιος Παπαϊωάννου (2013-14) gepap@aueb.gr Περιγραφή: Ο τύπος string Μετατροπή από και προς τον τύπο string Βασικές μέθοδοι Χρήση Ελληνικών Συναρτήσεις C εκτύπωσης και ανάγνωσης Τελευταία

Διαβάστε περισσότερα

Αρχές Προγραμματισμού

Αρχές Προγραμματισμού Αρχές Προγραμματισμού https://eclass.upatras.gr/courses/ee806/index.php Βασίλης Παλιουράς paliuras@ece.upatras.gr Άσκηση Να γραφεί πρόγραμμα που να αθροίζει δύο διανύσματα Ν στοιχείων σε ISO C90 χρησιμοποιώντας

Διαβάστε περισσότερα

Αναφορές, είκτες και Αλφαριθμητικά

Αναφορές, είκτες και Αλφαριθμητικά Αναφορές, είκτες και Αλφαριθμητικά Ο τελεστής αναφοροποίησης Αναφορές είκτες Πίνακες και δείκτες Ο τελεστής new και delete υναμικοί πίνακες είκτες προς συναρτήσεις Αλφαριθμητικά της C Πίνακες Αλφαριθμητικών

Διαβάστε περισσότερα

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β 3.4 SUM AND DIFFERENCE FORMULAS Page Theorem cos(αβ cos α cos β -sin α cos(α-β cos α cos β sin α NOTE: cos(αβ cos α cos β cos(α-β cos α -cos β Proof of cos(α-β cos α cos β sin α Let s use a unit circle

Διαβάστε περισσότερα

Κεφάλαιο Αλφαριθµητικές Σειρές Χαρακτήρων (Strings)

Κεφάλαιο Αλφαριθµητικές Σειρές Χαρακτήρων (Strings) Κεφάλαιο 9.1-9.2 Αλφαριθµητικές Σειρές Χαρακτήρων (Strings) ( ιάλεξη 19) ιδάσκων: ηµήτρης Ζεϊναλιπούρ 1) Strings στη C Ένα string είναι µία ακολουθία αλφαριθµητικών χαρακτήρων, σηµείων στίξης κτλ. Π.χ.

Διαβάστε περισσότερα

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required) Phys460.nb 81 ψ n (t) is still the (same) eigenstate of H But for tdependent H. The answer is NO. 5.5.5. Solution for the tdependent Schrodinger s equation If we assume that at time t 0, the electron starts

Διαβάστε περισσότερα

EE512: Error Control Coding

EE512: Error Control Coding EE512: Error Control Coding Solution for Assignment on Finite Fields February 16, 2007 1. (a) Addition and Multiplication tables for GF (5) and GF (7) are shown in Tables 1 and 2. + 0 1 2 3 4 0 0 1 2 3

Διαβάστε περισσότερα

Υπολογισμός - Εντολές Ελέγχου

Υπολογισμός - Εντολές Ελέγχου Προγραμματισμός Η/Υ Ι Υπολογισμός - Εντολές Ελέγχου ΕΛΕΥΘΕΡΙΟΣ ΚΟΣΜΑΣ ΕΑΡΙΝΟ ΕΞΑΜΗΝΟ 2018-2019 ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ Τ.Ε. 1 Περίληψη Σήμερα... θα συνεχίσουμε τη συζήτησή μας για τα βασικά στοιχεία

Διαβάστε περισσότερα

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016 Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Dynamic types, Lambda calculus machines Apr 21 22, 2016 1 Dynamic types and contracts (a) To make sure you understand the

Διαβάστε περισσότερα

ST5224: Advanced Statistical Theory II

ST5224: Advanced Statistical Theory II ST5224: Advanced Statistical Theory II 2014/2015: Semester II Tutorial 7 1. Let X be a sample from a population P and consider testing hypotheses H 0 : P = P 0 versus H 1 : P = P 1, where P j is a known

Διαβάστε περισσότερα

ΗΥ-150. Προγραμματισμός

ΗΥ-150. Προγραμματισμός ΗΥ-150 Προγραμματισμός Δείκτες (Pointers) Προγραμματισμός Δείκτες Τι είναι: τύπος μεταβλητών (όπως integer) Τι αποθηκεύουν: την διεύθυνση στη μνήμη άλλων μεταβλητών Τι χρειάζονται: Κυρίως, για δυναμική

Διαβάστε περισσότερα

Δομημένος Προγραμματισμός

Δομημένος Προγραμματισμός ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ Ανώτατο Εκπαιδευτικό Ίδρυμα Πειραιά Τεχνολογικού Τομέα Δομημένος Προγραμματισμός Ενότητα: Αλφαριθμητικά θεωρία Δ. Ε. Μετάφας Τμ. Ηλεκτρονικών Μηχ. Τ.Ε. Άδειες Χρήσης Το παρόν εκπαιδευτικό

Διαβάστε περισσότερα

Γλώσσα Προγραμματισμού C++ Εισαγωγή - Μια πρώτη ματιά

Γλώσσα Προγραμματισμού C++ Εισαγωγή - Μια πρώτη ματιά Γλώσσα Προγραμματισμού C++ Εισαγωγή - Μια πρώτη ματιά Βασικά χαρακτηριστικά αναπτύχθηκε ως επέκταση της C το 1979 υπερσύνολο της C γλώσσα γενικού σκοπού, γρήγορη, Αντικειμενοστραφής προγραμματισμός (Object

Διαβάστε περισσότερα

Every set of first-order formulas is equivalent to an independent set

Every set of first-order formulas is equivalent to an independent set Every set of first-order formulas is equivalent to an independent set May 6, 2008 Abstract A set of first-order formulas, whatever the cardinality of the set of symbols, is equivalent to an independent

Διαβάστε περισσότερα

Ανάπτυξη και Σχεδίαση Λογισμικού

Ανάπτυξη και Σχεδίαση Λογισμικού Ανάπτυξη και Σχεδίαση Λογισμικού Η γλώσσα προγραμματισμού C Γεώργιος Δημητρίου Αλφαριθμητικά και Αρχεία Αλφαριθμητικά (strings) Αρχεία (files) τα βασικά στοιχεία Αλφαριθμητικά της C Συμβολοσειρές (= ακολουθίες

Διαβάστε περισσότερα

ΑΡΧΕΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΥ

ΑΡΧΕΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΥ ΑΡΧΕΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΥ Κεφάλαιο 9 Επιμέλεια: Βασίλης Παλιουράς, Αναπληρωτής Καθηγητής Ευάγγελος Δερματάς, Αναπληρωτής Καθηγητής Σταύρος Νούσιας, Βοηθός Ερευνητή Πολυτεχνική Σχολή Τμήμα Ηλεκτρολόγων Μηχανικών

Διαβάστε περισσότερα

Διάλεξη 2: Επανάληψη Προγραμματισμού Συμβολοσειρές (strings) Διδάσκων: Παναγιώτης Ανδρέου

Διάλεξη 2: Επανάληψη Προγραμματισμού Συμβολοσειρές (strings) Διδάσκων: Παναγιώτης Ανδρέου Διάλεξη 2: Επανάληψη Προγραμματισμού Συμβολοσειρές (strings) Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: Εισαγωγή στις έννοιες: - Εισαγωγικές Έννοιες σε Strings - Πίνακες από Strings - Συναρτήσεις

Διαβάστε περισσότερα

Εργαστήριο Οργάνωσης Η/Υ. Δαδαλιάρης Αντώνιος

Εργαστήριο Οργάνωσης Η/Υ. Δαδαλιάρης Αντώνιος Εργαστήριο Οργάνωσης Η/Υ Δαδαλιάρης Αντώνιος dadaliaris@uth.gr Σχόλια: - - This is a single line comment - - There is no alternative way to write multi-line comments Αναγνωριστικά: Τα αναγνωριστικά

Διαβάστε περισσότερα

ΕΙΣΑΓΩΓΗ ΣΤΟN ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ ΚΑΙ ΠΛΗΡΟΦΟΡΙΚΗΣ

ΕΙΣΑΓΩΓΗ ΣΤΟN ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ ΚΑΙ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΙΣΑΓΩΓΗ ΣΤΟN ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ ΚΑΙ ΠΛΗΡΟΦΟΡΙΚΗΣ Εμβέλεια Μεταβλητών Εμβέλεια = το τμήμα του προγράμματος στο οποίο έχει ισχύ ή είναι ορατή η μεταβλητή.

Διαβάστε περισσότερα

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων Εξάμηνο 7 ο Procedures and Functions Stored procedures and functions are named blocks of code that enable you to group and organize a series of SQL and PL/SQL

Διαβάστε περισσότερα

Areas and Lengths in Polar Coordinates

Areas and Lengths in Polar Coordinates Kiryl Tsishchanka Areas and Lengths in Polar Coordinates In this section we develop the formula for the area of a region whose boundary is given by a polar equation. We need to use the formula for the

Διαβάστε περισσότερα

Π. Σταθοπούλου ή Οµάδα Α (Φοιτητές µε µονό αριθµό Μητρώου ) ιδασκαλία : Παρασκευή 11πµ-13µµ ΗΛ7

Π. Σταθοπούλου ή Οµάδα Α (Φοιτητές µε µονό αριθµό Μητρώου ) ιδασκαλία : Παρασκευή 11πµ-13µµ ΗΛ7 Π. Σταθοπούλου pstath@ece.upatras.gr ή pstath@upatras.gr Οµάδα Α (Φοιτητές µε µονό αριθµό Μητρώου ) ιδασκαλία : Παρασκευή 11πµ-13µµ ΗΛ7 Φροντιστήριο : ευτέρα 11πµ-12πµ ΗΛ4 ❶ Προετοιµασία για το 1 ο Εργαστήριο

Διαβάστε περισσότερα

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Συστήματα Διαχείρισης Βάσεων Δεδομένων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Φροντιστήριο 9: Transactions - part 1 Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών Tutorial on Undo, Redo and Undo/Redo

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Όλοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι του 10000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Αν κάπου κάνετε κάποιες υποθέσεις

Διαβάστε περισσότερα

Προγραμματισμός Ι (ΗΥ120)

Προγραμματισμός Ι (ΗΥ120) Προγραμματισμός Ι (ΗΥ120) Διάλεξη 8: Πίνακες, Αλφαριθμητικά Πίνακες Ο πίνακας είναι μια ειδική δομή για την αποθήκευση μιας σειράς από δεδομένα του ίδιου τύπου. Η δήλωση ενός πίνακα γίνεται όπως για μια

Διαβάστε περισσότερα

17TimeThis.h function returns reference pointer to same object { return *this; }

17TimeThis.h function returns reference pointer to same object { return *this; } Προαπαιτούµενη Κάθε οµάδα θα πρέπει να εµπλουτίσει το ίδιο πρόγραµµα, που έκανε την προηγούµενη φορά, προσθέτοντας στην κλάση του έναν ή περισσότερους υπερφορτωµένους τελεστές (όπως , ++, +,-,+=..)

Διαβάστε περισσότερα

Ανάπτυξη Μεγάλων Εφαρµογών στη Γλώσσα C (2)

Ανάπτυξη Μεγάλων Εφαρµογών στη Γλώσσα C (2) Ανάπτυξη Μεγάλων Εφαρµογών στη Γλώσσα C (2) Στην ενότητα αυτή θα µελετηθούν τα εξής επιµέρους θέµατα: Οργάνωση Προγράµµατος Header Files Μετάφραση και σύνδεση αρχείων προγράµµατος ΕΠΛ 132 Αρχές Προγραµµατισµού

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006 ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/26 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι το 1 εκτός αν ορίζεται διαφορετικά στη διατύπωση

Διαβάστε περισσότερα

Τμήμα Πληροφορικής & Επικοινωνιών Δρ. Θεόδωρος Γ. Λάντζος

Τμήμα Πληροφορικής & Επικοινωνιών Δρ. Θεόδωρος Γ. Λάντζος Τμήμα Πληροφορικής & Επικοινωνιών Δρ. Θεόδωρος Γ. Λάντζος http://www.teiser.gr/icd/staff/lantzos lantzos@teiser.gr 1 Μονοδιάστατοι Πίνακες (tables) Μια συλλογή μεταβλητών ίδιου τύπου οι οποίες είναι αποθηκευμένες

Διαβάστε περισσότερα

Εισαγωγή στον Προγραµµατισµό. Διάλεξη 2 η : Βασικές Έννοιες της γλώσσας προγραµµατισµού C Χειµερινό Εξάµηνο 2011

Εισαγωγή στον Προγραµµατισµό. Διάλεξη 2 η : Βασικές Έννοιες της γλώσσας προγραµµατισµού C Χειµερινό Εξάµηνο 2011 Εισαγωγή στον Προγραµµατισµό Διάλεξη 2 η : Βασικές Έννοιες της γλώσσας προγραµµατισµού C Χειµερινό Εξάµηνο 2011 Hello World /* Αρχείο hello.c * Εµφανίζει στην οθόνη το * µήνυµα hello world */ #include

Διαβάστε περισσότερα

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits. EAMCET-. THEORY OF EQUATIONS PREVIOUS EAMCET Bits. Each of the roots of the equation x 6x + 6x 5= are increased by k so that the new transformed equation does not contain term. Then k =... - 4. - Sol.

Διαβάστε περισσότερα

derivation of the Laplacian from rectangular to spherical coordinates

derivation of the Laplacian from rectangular to spherical coordinates derivation of the Laplacian from rectangular to spherical coordinates swapnizzle 03-03- :5:43 We begin by recognizing the familiar conversion from rectangular to spherical coordinates (note that φ is used

Διαβάστε περισσότερα

Προγραµµατισµός Ι Αλφαριθµητικά Πανεπιστήµιο Πελοποννήσου Τµήµα Πληροφορικής & Τηλεπικοινωνιών Προγραµµατισµός Ι 1 Νικόλαος Δ.

Προγραµµατισµός Ι Αλφαριθµητικά Πανεπιστήµιο Πελοποννήσου Τµήµα Πληροφορικής & Τηλεπικοινωνιών Προγραµµατισµός Ι 1 Νικόλαος Δ. Αλφαριθµητικά Πανεπιστήµιο Πελοποννήσου Τµήµα Πληροφορικής & Τηλεπικοινωνιών Νικόλαος Δ. Τσελίκας Νικόλαος Προγραµµατισµός Δ. Τσελίκας Ι 1 Αλφαριθµητικά - Εισαγωγή Ένα αλφαριθµητικό (string) είναι µία

Διαβάστε περισσότερα

Finite Field Problems: Solutions

Finite Field Problems: Solutions Finite Field Problems: Solutions 1. Let f = x 2 +1 Z 11 [x] and let F = Z 11 [x]/(f), a field. Let Solution: F =11 2 = 121, so F = 121 1 = 120. The possible orders are the divisors of 120. Solution: The

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial Introduction Το Javadoc είναι ένα εργαλείο που παράγει αρχεία html (παρόμοιο με τις σελίδες στη διεύθυνση http://docs.oracle.com/javase/8/docs/api/index.html) από τα σχόλια

Διαβάστε περισσότερα

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation Overview Transition Semantics Configurations and the transition relation Executions and computation Inference rules for small-step structural operational semantics for the simple imperative language Transition

Διαβάστε περισσότερα

Διάλεξη 3: Προγραμματισμός σε JAVA I. Διδάσκων: Παναγιώτης Ανδρέου

Διάλεξη 3: Προγραμματισμός σε JAVA I. Διδάσκων: Παναγιώτης Ανδρέου Διάλεξη 3: Προγραμματισμός σε JAVA I Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: Εισαγωγή στις έννοιες: - Στοιχειώδης Προγραμματισμός - Προγραμματισμός με Συνθήκες - Προγραμματισμός με Βρόγχους

Διαβάστε περισσότερα

Προγραμματισμός Ι (ΗΥ120)

Προγραμματισμός Ι (ΗΥ120) Προγραμματισμός Ι (ΗΥ120) Διάλεξη 3: Είσοδος / Έξοδος, Βασικοί Τύποι, Δήλωση Μεταβλητών Βασικοί τύποι της C 2 Όνομα Τύπος / Κωδικοποίηση Μέγεθος (bytes) char Χαρακτήρας 1 int Ακέραιος 2 ή 4 (*) float Πραγματικός

Διαβάστε περισσότερα

Προγραμματισμός II. Δυναμική διαχείριση μνήμης

Προγραμματισμός II. Δυναμική διαχείριση μνήμης Δυναμική διαχείριση μνήμης Ένας πίνακας ελέγχει ένα συγκεκριμένο μπλοκ μνήμης. Το μέγεθος ενός πίνακα είναι σταθερό: καθορισμένο όταν το πρόγραμμα έχει γραφεί. int array[4]; Οι δείκτες μπορούν να δείξουν

Διαβάστε περισσότερα

Η εντολή if-else. Η απλή μορφή της εντολής if είναι η ακόλουθη: if (συνθήκη) { Η γενική μορφή της εντολής ifelse. εντολή_1; εντολή_2;..

Η εντολή if-else. Η απλή μορφή της εντολής if είναι η ακόλουθη: if (συνθήκη) { Η γενική μορφή της εντολής ifelse. εντολή_1; εντολή_2;.. Επιλογή - Επανάληψη Η εντολή if-else Ο τελεστής παράστασης συνθήκης H εντολή switch Η εντολές for και while Η εντολή do-while Η εντολές break - continue - goto Μαθηματικές συναρτήσεις Λέξεις κλειδιά στη

Διαβάστε περισσότερα

Block Ciphers Modes. Ramki Thurimella

Block Ciphers Modes. Ramki Thurimella Block Ciphers Modes Ramki Thurimella Only Encryption I.e. messages could be modified Should not assume that nonsensical messages do no harm Always must be combined with authentication 2 Padding Must be

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ. Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ. Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2 ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2 Διδάσκων: Γιάννης Θεοδωρίδης Συντάκτης Κειμένου: Βαγγέλης Κατσικάρος Φεβρουάριος 2008 Περιεχόμενα SQL Language

Διαβάστε περισσότερα

Areas and Lengths in Polar Coordinates

Areas and Lengths in Polar Coordinates Kiryl Tsishchanka Areas and Lengths in Polar Coordinates In this section we develop the formula for the area of a region whose boundary is given by a polar equation. We need to use the formula for the

Διαβάστε περισσότερα

Section 7.6 Double and Half Angle Formulas

Section 7.6 Double and Half Angle Formulas 09 Section 7. Double and Half Angle Fmulas To derive the double-angles fmulas, we will use the sum of two angles fmulas that we developed in the last section. We will let α θ and β θ: cos(θ) cos(θ + θ)

Διαβάστε περισσότερα

Εργαστήριο 2ο. Περίγραμμα Εργαστηριακής Άσκησης

Εργαστήριο 2ο. Περίγραμμα Εργαστηριακής Άσκησης Γλώσσες Προγραμματισμού Εργαστήριο 2ο Τύποι Δεδομένων - Είσοδος / Έξοδος Εργαστήριο 2ο Περίγραμμα Εργαστηριακής Άσκησης Εργαστήριο 2ο...1 Θεωρία εργαστηρίου...2 Τύποι δεδομένων...2 Η συνάρτηση printf()...3

Διαβάστε περισσότερα

Lecture 2. Soundness and completeness of propositional logic

Lecture 2. Soundness and completeness of propositional logic Lecture 2 Soundness and completeness of propositional logic February 9, 2004 1 Overview Review of natural deduction. Soundness and completeness. Semantics of propositional formulas. Soundness proof. Completeness

Διαβάστε περισσότερα

Η γλώσσα προγραμματισμού C

Η γλώσσα προγραμματισμού C Η γλώσσα προγραμματισμού C Χειρισμός χαρακτήρων, συμβολοσειρές Συμβολοσειρές Συμβολοσειρά ονομάζουμε μια οποιαδήποτε ακολουθία αλφαριθμητικών χαρακτήρων: «Κώστας», «Κώστας Βασιλάκης», «Δαιδάλου 23» Στην

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ ΗΛΕΚΤΡΟΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ & ΠΛΗΡΟΦΟΡΙΚΗΣ

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ ΗΛΕΚΤΡΟΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ & ΠΛΗΡΟΦΟΡΙΚΗΣ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ ΗΛΕΚΤΡΟΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ & ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΙΣΑΓΩΓΗ ΣΤΟ ΙΑ ΙΚΑΣΤΙΚΟ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ (2010-2011) ΥΠΕΥΘΥΝΟΙ Ι ΑΣΚΟΝΤΕΣ ΕΡΓΑΣΤΗΡΙΟΥ: Α. ΦΩΚΑ, Κ. ΣΤΑΜΟΣ 3

Διαβάστε περισσότερα

ΕΡΓΑΣΤΗΡΙΟ 1 - ΣΗΜΕΙΩΣΕΙΣ

ΕΡΓΑΣΤΗΡΙΟ 1 - ΣΗΜΕΙΩΣΕΙΣ ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΙΑΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΑΚΑΔΗΜΑΪΚΟ ΕΤΟΣ 2017-2018 ΧΕΙΜΕΡΙΝΟ ΕΞΑΜΗΝΟ ΜΑΘΗΜΑ: ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ Εισαγωγή ΕΡΓΑΣΤΗΡΙΟ 1 - ΣΗΜΕΙΩΣΕΙΣ Ένα πρόγραμμα σε C περιλαμβάνει μια ή περισσότερες συναρτήσεις

Διαβάστε περισσότερα

#define, 70, 575 #elif, 580 #else, 580 #endif, 580 #error, 584 #if, 580 #ifdef, 583 #ifndef, 580, 583 #include, 70, 227, 574 #undef, 579

#define, 70, 575 #elif, 580 #else, 580 #endif, 580 #error, 584 #if, 580 #ifdef, 583 #ifndef, 580, 583 #include, 70, 227, 574 #undef, 579 Ευρετήριο Η γλώσσα C σε βάθος # #define, 70, 575 #elif, 580 #else, 580 #endif, 580 #error, 584 #if, 580 #ifdef, 583 #ifndef, 580, 583 #include, 70, 227, 574 #undef, 579 A abs(), 625 AND, 64 ASCII πίνακας

Διαβάστε περισσότερα

Γ7.2 Συμβολοσειρές (Strings) Γ Λυκείου Κατεύθυνσης

Γ7.2 Συμβολοσειρές (Strings) Γ Λυκείου Κατεύθυνσης Γ7.2 Συμβολοσειρές (Strings) Γ Λυκείου Κατεύθυνσης Εισαγωγή Στη C++ υπάρχει η δυνατότητα να δηλώσουμε μία συμβολοσειρά ως αντικείμενο, χρησιμοποιώντας τη βιβλιοθήκη . Επειδή οι συμβολοσειρές είναι

Διαβάστε περισσότερα

Διάλεξη 9η: Πίνακες (arrays)

Διάλεξη 9η: Πίνακες (arrays) Διάλεξη 9η: Πίνακες (arrays) Τμήμα Επιστήμης Υπολογιστών, Πανεπιστήμιο Κρήτης Εισαγωγή στην Επιστήμη Υπολογιστών Βασίζεται σε διαφάνειες του Κ Παναγιωτάκη Πρατικάκης (CSD) Arrays CS100, 2016-2017 1 / 17

Διαβάστε περισσότερα

Η γλώσσα C. Δείκτες (pointers)

Η γλώσσα C. Δείκτες (pointers) Η γλώσσα C Δείκτες (pointers) Δείκτες - Pointers Δείκτης: τι είναι; Μια μεταβλητή που περιέχει τη διεύθυνση μιας άλλης μεταβλητής 1000 1028 Μεταβλητή p int c = 10; int *p; p = &c; 1028 10 Μεταβλητή c *p

Διαβάστε περισσότερα

Η γλώσσα προγραμματισμού C

Η γλώσσα προγραμματισμού C Η γλώσσα προγραμματισμού C Χειρισμός χαρακτήρων, συμβολοσειρές Συμβολοσειρές Συμβολοσειρά ονομάζουμε μια οποιαδήποτε ακολουθία αλφαριθμητικών χαρακτήρων: «Κώστας», «Κώστας Βασιλάκης», «Δαιδάλου 23» Στην

Διαβάστε περισσότερα

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι She selects the option. Jenny starts with the al listing. This has employees listed within She drills down through the employee. The inferred ER sttricture relates this to the redcords in the databasee

Διαβάστε περισσότερα

Other Test Constructions: Likelihood Ratio & Bayes Tests

Other Test Constructions: Likelihood Ratio & Bayes Tests Other Test Constructions: Likelihood Ratio & Bayes Tests Side-Note: So far we have seen a few approaches for creating tests such as Neyman-Pearson Lemma ( most powerful tests of H 0 : θ = θ 0 vs H 1 :

Διαβάστε περισσότερα

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in : tail in X, head in A nowhere-zero Γ-flow is a Γ-circulation such that

Διαβάστε περισσότερα

Math221: HW# 1 solutions

Math221: HW# 1 solutions Math: HW# solutions Andy Royston October, 5 7.5.7, 3 rd Ed. We have a n = b n = a = fxdx = xdx =, x cos nxdx = x sin nx n sin nxdx n = cos nx n = n n, x sin nxdx = x cos nx n + cos nxdx n cos n = + sin

Διαβάστε περισσότερα

4.6 Autoregressive Moving Average Model ARMA(1,1)

4.6 Autoregressive Moving Average Model ARMA(1,1) 84 CHAPTER 4. STATIONARY TS MODELS 4.6 Autoregressive Moving Average Model ARMA(,) This section is an introduction to a wide class of models ARMA(p,q) which we will consider in more detail later in this

Διαβάστε περισσότερα

Β. Εισαγωγή στον Προγραμματισμό Η/Υ με την JavaScript

Β. Εισαγωγή στον Προγραμματισμό Η/Υ με την JavaScript Β. Εισαγωγή στον Προγραμματισμό Η/Υ με την JavaScript Β.1 Τύποι Δεδομένων Όλες οι γλώσσες προγραμματισμού (πρέπει να) υποστηρίζουν πέντε (5) πρωταρχικούς τύπους δεδομένων: char (character) int (integer)

Διαβάστε περισσότερα

Αρχές Προγραμματισμού

Αρχές Προγραμματισμού Αρχές Προγραμματισμού https://eclass.upatras.gr/courses/ee806/index.php Βασίλης Παλιουράς paliuras@ece.upatras.gr Project σε Dev-C++ 2 1 Δείκτες (Pointers) Δείκτης: μεταβλητή στην οποία αποθηκεύουμε διεύθυνση

Διαβάστε περισσότερα

Προγραμματισμός Ι. Πίνακες, Δείκτες, Αναφορές και Δυναμική Μνήμη. Δημήτρης Μιχαήλ. Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο

Προγραμματισμός Ι. Πίνακες, Δείκτες, Αναφορές και Δυναμική Μνήμη. Δημήτρης Μιχαήλ. Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο Προγραμματισμός Ι Πίνακες, Δείκτες, Αναφορές και Δυναμική Μνήμη Δημήτρης Μιχαήλ Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο Πίνακες Αντικειμένων Όπως στην C μπορούμε να έχουμε πίνακες από

Διαβάστε περισσότερα

Matrices and Determinants

Matrices and Determinants Matrices and Determinants SUBJECTIVE PROBLEMS: Q 1. For what value of k do the following system of equations possess a non-trivial (i.e., not all zero) solution over the set of rationals Q? x + ky + 3z

Διαβάστε περισσότερα

Instruction Execution Times

Instruction Execution Times 1 C Execution Times InThisAppendix... Introduction DL330 Execution Times DL330P Execution Times DL340 Execution Times C-2 Execution Times Introduction Data Registers This appendix contains several tables

Διαβάστε περισσότερα

Lab 1: C/C++ Pointers and time.h. Panayiotis Charalambous 1

Lab 1: C/C++ Pointers and time.h. Panayiotis Charalambous 1 Lab 1: C/C++ Pointers and time.h Panayiotis Charalambous 1 Send email to totis@cs.ucy.ac.cy Subject: EPL231-Registration Body: Surname Firstname ID Group A or B? Panayiotis Charalambous 2 Code Guidelines:

Διαβάστε περισσότερα