struct LIST { int number; struct LIST *next; }; // void Push(struct LIST** list, int number) { struct LIST* node = malloc(sizeof(struct LIST)); node->number = number; node->next = *list; *list = node; } // void Print(const struct LIST* list) { if (list) { Print(list->next); printf("%d ", list->number); } } // int main() { int i = 10; struct LIST* list = NULL; while (i--) { Push(&list, i + 1); } //---(это разделение разных программ)
ivanandrieiev1984268
26.11.2021
Const d = '0123456789';
var i, m, k: longint; c: char; n: string;
begin Write('Введите шестнадцатиричное число: '); Readln(n); m := 0; while n[1] = '0' do delete(n, 1, 1); for i := 1 to length(n) do begin c := n[i]; case c of 'F', 'f': k := 15; 'E', 'e': k := 14; 'D', 'd': k := 13; 'C', 'c': k := 12; 'B', 'b': k := 11; 'A', 'a': k := 10; else k := Pos(c, d) - 1 end; m := 16 * m + k end; Writeln(n, '(16)=', m, '(10)') end.
#include <stdio.h>
#include <stdlib.h>
struct LIST {
int number;
struct LIST *next; };
//
void Push(struct LIST** list, int number) {
struct LIST* node = malloc(sizeof(struct LIST));
node->number = number;
node->next = *list;
*list = node; }
//
void Print(const struct LIST* list) {
if (list) {
Print(list->next);
printf("%d ", list->number); } }
//
int main() {
int i = 10;
struct LIST* list = NULL;
while (i--) {
Push(&list, i + 1); }
//---(это разделение разных программ)