Long time no see
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
// Разработайте функцию, выполняющую преобразование строки
|
||||
//с однобайтовым двоичным числом в целое десятичное число.
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
char input;
|
||||
long long int binary = 0;
|
||||
int decimal = 0;
|
||||
|
||||
// Input
|
||||
{
|
||||
printf("Input binary: ");
|
||||
while((input=getchar())>='0' && input <= '1'){
|
||||
binary = (binary * 10) + (input - '0');
|
||||
}
|
||||
|
||||
if(input != '\n' && input != EOF && input != 4){
|
||||
printf("Err, handle char not a 1 or 0");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// __
|
||||
|
||||
// Func
|
||||
int base = 1;// base = (2**n)
|
||||
long long int bin = binary;
|
||||
while (binary) {
|
||||
int last = binary % 10;
|
||||
|
||||
binary = binary / 10;
|
||||
|
||||
decimal += last * base;
|
||||
base = base * 2;
|
||||
}
|
||||
// __
|
||||
|
||||
// Output
|
||||
printf("binary(%lld) = decimal(%d)",bin,decimal);
|
||||
return 0;
|
||||
// __
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
Executable
+1
@@ -0,0 +1 @@
|
||||
gcc -std=c99 -Wall main.c func.c -o prog
|
||||
@@ -0,0 +1,557 @@
|
||||
#include "head.h"
|
||||
|
||||
int queryinput(int *x, int *inquery, int *query){
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
//INPUT-------------------------------------------------
|
||||
wint_t ch;
|
||||
*inquery = 0;
|
||||
while((ch=getwchar())!=L'\n'&&ch!=L'\t'&&ch!=L' '&&*inquery<QUERYMAX){
|
||||
*(query+*inquery)=(int)ch;
|
||||
(*inquery)++;
|
||||
}
|
||||
//______________________________________________________
|
||||
|
||||
if(ch == WEOF)return -1;
|
||||
|
||||
//COUNT -------------------------------------------------
|
||||
int c=0;
|
||||
|
||||
if(ch==L'\n')x[2]++;
|
||||
else if(ch==L'\t')x[3]++;
|
||||
else if(ch==L' ')x[4]++;
|
||||
|
||||
while (c < *inquery)
|
||||
{
|
||||
int sym = query[c];
|
||||
if ((sym >= L'а' && sym <= L'я') ||
|
||||
(sym >= L'А' && sym <= L'Я'))
|
||||
{
|
||||
x[0]++;
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
if (sym >= L'0' && sym <= L'9')
|
||||
{
|
||||
x[1]++;
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
if (sym > 32 && sym <= 47) {
|
||||
x[sym - 28]++;
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
if (sym > 58 && sym <= 64) {
|
||||
x[sym - 38]++;
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
x[33]++;
|
||||
c++;
|
||||
}
|
||||
//________________________________________________________
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func1 (char **f, int *x,int inquery, int *query){
|
||||
switch(funcReturn(f[2])){
|
||||
case 1://Определяет среднюю длину слова в тексте
|
||||
{
|
||||
if(x[32]){
|
||||
x[30]/=x[31];
|
||||
printf("\n\tСредняя длинна слова - %d",x[30]);
|
||||
}
|
||||
else{
|
||||
x[30]+=inquery;
|
||||
x[31]++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 2://Подсчитывает количество слов, длина которых не превышает 5 символов.
|
||||
{
|
||||
if(x[32]){
|
||||
printf("\n\tВсего слов <5 букв - %d",x[30]);
|
||||
}
|
||||
else if(inquery<5)x[30]++;
|
||||
break;
|
||||
}
|
||||
|
||||
case 3://Определяет количество букв после первого и до последнего слова.
|
||||
{
|
||||
if(x[31]);
|
||||
else {x[30]-=x[0];x[31]=1;}
|
||||
if(x[32]){x[30]+=x[0];printf("\n\tКолл-во букв после 1 и до последнего слова - %d",x[30]);}
|
||||
break;
|
||||
}
|
||||
case 4://Удаляет первую букву каждого слова и выводит результат.
|
||||
{
|
||||
if(x[32]);
|
||||
else
|
||||
put(x,1,inquery,query);
|
||||
break;
|
||||
}
|
||||
|
||||
case 5://определяет, сколько в заданном тексте слов, начинающихся с буквы,заданной пользователем.
|
||||
{
|
||||
if(x[32])
|
||||
printf("\n\t Слов начинающихся на %c - %d",f[4][0],x[30]);
|
||||
else
|
||||
if(query[0]==f[3][0])x[30]++;
|
||||
break;
|
||||
}
|
||||
case 6://находит сумму всех цифр в введенном предложении. (если в тексте нетцифр, добавить) предусмотреть обработку шаблонов (12word, wo12rd,word12)
|
||||
{
|
||||
if(x[32])
|
||||
printf("\n\t Найти сумму всех цифр - %d",x[31]);
|
||||
else
|
||||
for(int i=0;i<inquery;i++){
|
||||
if(query[i]>=L'0'&&query[i]<=L'9'){
|
||||
x[30]=(x[30]*100)+(query[i]-L'0');
|
||||
}
|
||||
}
|
||||
x[31]+=x[30];
|
||||
x[30]=0;
|
||||
break;
|
||||
}
|
||||
|
||||
case 7:// вставляет восклицательный знак в конце каждой строки текста.
|
||||
{
|
||||
if(x[32]);
|
||||
else{
|
||||
if(query[inquery-1]==L'\n'){
|
||||
if(query[inquery-2]==L'!'||query[inquery-2]==L'?'||query[inquery-2]==L'.'||query[inquery-2]==L',')
|
||||
query[inquery-2]=L'!';
|
||||
else {query[inquery-1]=L'!';query[inquery]=L'\n';}
|
||||
x[L'!'-28]++;inquery++;}
|
||||
put(x,0,inquery,query);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 8://проверяет заканчивается ли каждая строка точкой и добавляет ее при необходимости, считает сколько точек было добавлено
|
||||
{
|
||||
if(x[32]);
|
||||
else{
|
||||
if(query[inquery-1]==L'\n'){
|
||||
if(query[inquery-2]==L'!'||query[inquery-2]==L'?'||query[inquery-2]==L'.'||query[inquery-2]==L',')
|
||||
query[inquery-2]=L'.';
|
||||
else {query[inquery-1]=L'.';query[inquery]=L'\n';}
|
||||
x[L'!'-28]++;inquery++;}
|
||||
put(x,0,inquery,query);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 9://определяет сколько раз в введенной строке встречается слово,заданное пользователем.
|
||||
{
|
||||
if(x[32])
|
||||
printf("\n\t Слово %s встречается - %d раз",f[4],x[30]);
|
||||
else{
|
||||
if(last(inquery,query))inquery--;
|
||||
x[30]+=strquery(f[3],query);}
|
||||
break;
|
||||
}
|
||||
|
||||
case 10://подсчитывает количество букв в каждом втором слове.
|
||||
{
|
||||
x[34] = x[0] - x[33];
|
||||
if(x[32]){
|
||||
x[31]=x[33]-x[31];
|
||||
printf("\n\t Сумма букв в четных словах - %d",x[31]);
|
||||
}
|
||||
else{
|
||||
if(x[30]%2==0)
|
||||
x[31]+=x[34];
|
||||
x[33]+=x[33];
|
||||
x[30]++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func2 (char **f, int *x,int inquery, int *query,int *ch){
|
||||
switch(funcReturn(f[2])){
|
||||
case 1: //Подсчитывает, сколько слов начинается с последней буквы первого слова.
|
||||
{
|
||||
if(x[32]){
|
||||
printf("\n\t Количество букв начинающихся с %c - %d",x[32],x[34]);
|
||||
}
|
||||
else if(!(x[31])){x[31]=0;x[33]=query[inquery-1];}
|
||||
else{if (query[0]==x[33]){x[34]++;}}
|
||||
break;
|
||||
}
|
||||
case 2: //Подсчитывает, сколько слов имеют указанную пользователем длину.
|
||||
{
|
||||
if(x[32])printf("\n\t Слов имеющих указанную длинну - %d",x[30]);
|
||||
else{
|
||||
if(last(inquery,query))inquery--;
|
||||
if(strquery(f[3],query))x[30]++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: //Печатает самое длинное слово в тексте.
|
||||
{
|
||||
if(x[32]){printf("\n\t");}
|
||||
else{
|
||||
if(x[31]<inquery){
|
||||
for(int i = 0;i<inquery;i++)
|
||||
ch[i]=query[i];
|
||||
x[31]=inquery;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: //Подсчитывает количество знаков препинания (не букв и не цифр).
|
||||
{
|
||||
if(x[32]){printf("\n\tЗнаков препинания: %d",x[5]+x[16]+x[18]+x[25]);}
|
||||
break;
|
||||
}
|
||||
/*case 5: //Сортирует текст в порядке возрастания
|
||||
{
|
||||
break; Я хз что с этим делать
|
||||
}*/
|
||||
case 6: // Находит слова с тире во введенном тексте.
|
||||
{
|
||||
if(x[28]);
|
||||
else{
|
||||
for(int i = 0;i<inquery;i++){
|
||||
if(query[i]==L'-'&&inquery>1){
|
||||
x[30]=x[2];
|
||||
x[31]=x[3];
|
||||
x[33]=x[4];
|
||||
put(x,0,inquery,query);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 7: //Вычисляет количество слов между первой и последней запятой во введенном тексте
|
||||
{
|
||||
if(x[32]){printf("\n\tКолличество слов между первой и последней запятой - %d",x[34]);}
|
||||
else{
|
||||
if(x[L','-28]>0){
|
||||
x[31]+=inquery;
|
||||
if(x[L','-28]>x[33]){
|
||||
x[34]+=x[31];
|
||||
x[33]=x[31];
|
||||
x[31]=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 8: //Находит два соседних слова, начинающихся с большой буквы
|
||||
{
|
||||
if(x[28]);
|
||||
else{
|
||||
if(*query>=L'А'&&*query<=L'Я'){
|
||||
x[35]++;
|
||||
if(x[35]==2){
|
||||
x[30]=x[2];
|
||||
x[31]=x[3];
|
||||
x[33]=x[4];
|
||||
x[35]=0;
|
||||
printf("\n\t");
|
||||
put(x,0,x[34],ch);
|
||||
printf(" - ");
|
||||
put(x,0,inquery,query);
|
||||
printf(" | Находятся друг за другом");
|
||||
}
|
||||
for(int i = 0;i<inquery;i++)ch[i]=query[i];
|
||||
x[34]=inquery;
|
||||
}
|
||||
else {x[35] = 0;}
|
||||
}
|
||||
break;
|
||||
}
|
||||
/*case 9: //Сортирует строку в тексте по убыванию
|
||||
{
|
||||
Я снова хз
|
||||
break;
|
||||
}*/
|
||||
case 10://Заменяет в каждом слове повторяющиеся буквы на L'–'
|
||||
{
|
||||
if(x[32]);
|
||||
else{
|
||||
for(int i=0;i<inquery;i++){
|
||||
for(int j=0;j<inquery;j++)
|
||||
if(query[j]==query[i])query[j]=query[i]=L'-';
|
||||
}
|
||||
put(x,0,inquery,query);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func3 (char **f, int *x,int inquery, int *query){
|
||||
int alphabet[33*2] = {
|
||||
L'а',L'б',L'в',L'г',L'д',L'е',L'ё',L'ж',L'з',L'и',L'й',L'к',L'л',L'м',L'н',L'о',
|
||||
L'п',L'р',L'с',L'т',L'у',L'ф',L'х',L'ц',L'ч',L'ш',L'щ',L'ъ',L'ы',L'ь',L'э',L'ю',L'я',
|
||||
L'А',L'Б',L'В',L'Г',L'Д',L'Е',L'Ё',L'Ж',L'З',L'И',L'Й',L'К',L'Л',L'М',L'Н',L'О',
|
||||
L'П',L'Р',L'С',L'Т',L'У',L'Ф',L'Х',L'Ц',L'Ч',L'Ш',L'Щ',L'Ъ',L'Ы',L'Ь',L'Э',L'Ю',L'Я'
|
||||
};
|
||||
|
||||
switch(funcReturn(f[2])){
|
||||
case 1: //Реверсирует слово. Пример: Привет ->тевирП
|
||||
{
|
||||
put(x,inquery-1,0,query);
|
||||
break;
|
||||
}
|
||||
case 2: //Делит слово на два и меняет начало с концом. Пример: жук -> кжу,солнце -> нцесол
|
||||
{
|
||||
put(x,0,inquery/2,query);
|
||||
put(x,inquery/2,inquery,query);
|
||||
break;
|
||||
}
|
||||
case 3: //После каждой гласной буквы вставляется буква L'c' и гласная повторяется. Пример: кот ->косот.
|
||||
{
|
||||
int alph[20] = {L'а',L'и',L'е',L'ё',L'о',L'у',L'ы',L'э',L'ю',L'я',
|
||||
L'А',L'И',L'Е',L'Ё',L'О',L'У',L'Ы',L'Э',L'Ю',L'Я'};
|
||||
for(int i = 0;i<inquery;i++){
|
||||
for(int j = 0;j<=20;j++){
|
||||
if(query[i]==alph[j]){
|
||||
for(int z = 0;z<inquery-i;z++)
|
||||
query[inquery+1-z] = query[(inquery-1)-z];
|
||||
|
||||
query[i+1]=L'с';
|
||||
query[i+2]=query[i];
|
||||
inquery+=2;
|
||||
i+=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
put(x,0,inquery,query);
|
||||
break;
|
||||
}
|
||||
case 4: //Каждая буква в слове заменяется на ее позицию в алфавите. Пример: кот ->121620, обработать только буквы.
|
||||
{
|
||||
x[25]=-1;
|
||||
for(int i = 0;i<inquery;i++){
|
||||
if (query[i] >= L'а' && query[i] <= L'я'){
|
||||
x[25] = (query[i] - L'а') + 1;
|
||||
if(query[i]>=alphabet[8])x[25]++;}
|
||||
else if (query[i] == L'ё')
|
||||
x[25] = 7;
|
||||
else if (query[i] >= L'А' && query[i] <= L'Я'){
|
||||
x[25] = (query[i] - L'А') + 1;
|
||||
if(query[i]>=alphabet[41])x[25]++;}
|
||||
else if (query[i] == L'Ё')
|
||||
x[25] = 7;
|
||||
if(x[25]!=-1){printf("%d",x[25]);x[25]=-1;}
|
||||
}
|
||||
put(x,40,40,query);
|
||||
break;
|
||||
}
|
||||
case 5: //Заменяет буквы верхнего регистра на буквы нижнего и наоборот. Пример: Привет -> пРИВЕТ.
|
||||
{
|
||||
for(int i = 0;i<inquery;i++){
|
||||
for(int j = 0;j<=33*2;j++){
|
||||
if(query[i]==alphabet[j]&&j<33){
|
||||
query[i]=alphabet[j+33];
|
||||
}
|
||||
else if(query[i]==alphabet[j]&&j>32){
|
||||
query[i]=alphabet[i-33];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
put(x,0,inquery,query);
|
||||
break;
|
||||
}
|
||||
/*case 6: //Заменяет буквы на их двоичное представление из таблицы ASCII.Пример: кот ->101010101010111011100010
|
||||
{
|
||||
break;
|
||||
}*/
|
||||
case 7: /*Заменяет букву на заданное смещение в пределах алфавита (шифр
|
||||
Цезаря), смещение задаётся параметром и может быть положительным или
|
||||
отрицательным. Пример: кот 3 -> нсх, кот -3 -> злп*/
|
||||
{
|
||||
while(f[3][x[35]]>=L'0'&&f[3][x[35]]<=L'9'){
|
||||
x[34] = (x[34]*10)+(f[3][x[35]]-L'0');
|
||||
x[35]++;
|
||||
}
|
||||
for(int i = 0;i<inquery;i++){
|
||||
for(int j = 0;j<=33;j++){
|
||||
if(query[i]==alphabet[j]&&j<33){
|
||||
while(x[34]>33)x[34]-=33;
|
||||
if(j+x[34]>=33)x[34]-=33;
|
||||
query[i]=alphabet[j+x[34]];
|
||||
}
|
||||
|
||||
else if(query[i]==alphabet[j]&&j>32){
|
||||
while(x[34]>33)x[34]-=33;
|
||||
if(j+x[34]>=66)x[34]-=33;
|
||||
query[i]=alphabet[j+33+x[34]];
|
||||
}
|
||||
}
|
||||
}
|
||||
put(x,0,inquery,query);
|
||||
break;
|
||||
}
|
||||
case 8: //Делит слово на два и оставляет большую часть. Пример: жук -> к, солнце -> сол
|
||||
{
|
||||
if(inquery%2!=0)x[34]=1;
|
||||
else x[34]=0;
|
||||
for (int i = 0; i<(inquery/2)+x[34];i++)
|
||||
x[35] +=query[i];
|
||||
for (int i = (inquery/2)+x[34]; i<inquery;i++)
|
||||
x[36] +=query[i];
|
||||
if(x[35]>x[36])
|
||||
put(x,0,(inquery/2)+x[34],query);
|
||||
else
|
||||
put(x,(inquery/2)+x[34],inquery,query);
|
||||
break;
|
||||
}
|
||||
case 9: //Делит слово на два и оставляет меньшую часть. Пример: жук -> жу, солнце -> нце
|
||||
{
|
||||
if(inquery%2!=0)x[34]=1;
|
||||
else x[34]=0;
|
||||
for (int i = 0; i<(inquery/2)+x[34];i++)
|
||||
x[35] +=query[i];
|
||||
for (int i = (inquery/2)+x[34]; i<inquery;i++)
|
||||
x[36] +=query[i];
|
||||
if(x[35]<x[36])
|
||||
put(x,0,(inquery/2)+x[34],query);
|
||||
else
|
||||
put(x,(inquery/2)+x[34],inquery,query);
|
||||
|
||||
break;
|
||||
}
|
||||
case 10://Превращает русский текст в транслит русского текста. Пример кот ->kot, жук -> zhuk
|
||||
{
|
||||
int translit[43]={
|
||||
L'a',L'b',L'v',L'g',L'd',L'e' , L'y',/**/L'o' , L'z',/**/L'h' , L'z',L'i',L'y',L'k',L'l',L'm',L'n',L'o',
|
||||
L'p',L'r',L's',L't',L'u',L'f',L'h',L'c' , L'c',/**/L'h' , L's',/**/L'h' , L's',/**/L'h',/**/L'c',/**/L'h',
|
||||
L'\'',L'y',L'\'',L'e',L'e' , L'y',/**/L'u' , L'y',/**/L'a'};
|
||||
|
||||
for(int i =0;i>inquery;i++){
|
||||
if(
|
||||
(query[i] >= alphabet[0] && query[i] <= alphabet[5]) ||
|
||||
(query[i] >= alphabet[8] && query[i] <= alphabet[23]) ||
|
||||
(query[i] >= alphabet[27] && query[i] <= alphabet[30]) ||
|
||||
(query[i] >= alphabet[0+33] && query[i] <= alphabet[5+33]) ||
|
||||
(query[i] >= alphabet[8+33] && query[i] <= alphabet[23+33]) ||
|
||||
(query[i] >= alphabet[27+33] && query[i] <= alphabet[30+33]))
|
||||
{
|
||||
query[i]=translit[i];
|
||||
}
|
||||
else if (query[i] != alphabet[26] || query[i] != alphabet[26+33])
|
||||
{
|
||||
for(int z = 0;z<inquery-i;z++)
|
||||
query[inquery-z] = query[(inquery-1)-z];
|
||||
query[i]=translit[i];
|
||||
query[i+1]=translit[i+1];
|
||||
inquery++;i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int z = 0;z<inquery-i;z++)
|
||||
query[inquery-z] = query[(inquery-1)-z];
|
||||
for(int g =0;g<5;g++)
|
||||
query[i+g] = translit[i+g];
|
||||
inquery+=4;i+=4;
|
||||
}
|
||||
}
|
||||
put(x,0,inquery,query);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int last(int inquery,int *query){
|
||||
if((query[inquery-1]==L'.') ||
|
||||
(query[inquery-1]==L',') ||
|
||||
(query[inquery-1]==L'!') ||
|
||||
(query[inquery-1]==L'?')) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void put(int *x,int i,int inquery,int *query){
|
||||
|
||||
if(i<inquery)
|
||||
for(;i<inquery;i++)
|
||||
printf("%lc",query[i]);
|
||||
|
||||
if(i>inquery)
|
||||
for(;i>inquery;i--)
|
||||
printf("%lc",query[i]);
|
||||
|
||||
if(x[30]!=x[2]){putwchar(L'\n');}
|
||||
if(x[31]!=x[3]){putwchar(L'\t');}
|
||||
if(x[33]!=x[4]){putwchar(L' ');}
|
||||
x[30]=x[2];
|
||||
x[31]=x[3];
|
||||
x[33]=x[4];
|
||||
}
|
||||
|
||||
|
||||
void printcount(int *x){
|
||||
int sum = 0;
|
||||
printf("\nStatistic");
|
||||
printf("\n\t \"Symb\" - [ammount]\n");
|
||||
printf("\n\t \"Letters\" - [%d]",x[0]);
|
||||
printf("\n\t \"Digits\" - [%d]",x[1]);
|
||||
printf("\n\t \"\\n\" - [%d]",x[2]);
|
||||
printf("\n\t \"\\t\" - [%d]",x[3]);
|
||||
printf("\n\t \"space\" - [%d]",x[4]);
|
||||
|
||||
for (int i = 33; i <= 47; i++) {
|
||||
if (x[i-28] > 10)
|
||||
printf("\n\t \"%c\" - [%d]", i, x[i-28]);
|
||||
else
|
||||
sum+=x[i-28];
|
||||
}
|
||||
|
||||
for (int i = 58; i <= 64; i++) {
|
||||
if(x[i-38]>10)
|
||||
printf("\n\t \"%c\" = [%d]", i, x[i-32]);
|
||||
else
|
||||
sum+=x[i-38];
|
||||
}
|
||||
|
||||
printf("\n\t other - [%d]",sum+x[33]);
|
||||
}
|
||||
|
||||
|
||||
int str(char *a, char *b) {
|
||||
int i = 0;
|
||||
while(a[i] != L'\0' && b[i] != L'\0') {
|
||||
if(a[i] != b[i]) return 0;
|
||||
i++;
|
||||
}
|
||||
return a[i] == b[i];
|
||||
}
|
||||
|
||||
|
||||
int strquery(char *a, int *b){
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int funcReturn(char *f){
|
||||
int swt=0;
|
||||
if(str(f,"1"))swt=1;
|
||||
if(str(f,"2"))swt=2;
|
||||
if(str(f,"3"))swt=3;
|
||||
if(str(f,"4"))swt=4;
|
||||
if(str(f,"5"))swt=5;
|
||||
if(str(f,"6"))swt=6;
|
||||
if(str(f,"7"))swt=7;
|
||||
if(str(f,"8"))swt=8;
|
||||
if(str(f,"9"))swt=9;
|
||||
if(str(f,"10"))swt=10;
|
||||
return swt;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef HEAD
|
||||
#define HEAD
|
||||
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
#include <wchar.h>
|
||||
|
||||
|
||||
// GET
|
||||
int queryinput(int *x, int *inbuf, int *query);
|
||||
|
||||
|
||||
// FUNC
|
||||
void func1(char **f, int *x, int inquery, int *query);
|
||||
|
||||
void func2(char **f, int *x, int inquery, int *query, int *ch);
|
||||
|
||||
void func3(char **f, int *x, int inquery, int *query);
|
||||
|
||||
int last(int inquery,int *query);
|
||||
|
||||
void put(int *x,int i,int inquery,int *query);
|
||||
|
||||
void printcount(int *x);
|
||||
|
||||
int str(char *a,char *b);
|
||||
|
||||
int strquery(char *a,int *b);
|
||||
|
||||
int funcReturn(char *f);
|
||||
|
||||
// DEFINE
|
||||
#define clear printf("\n \033[H\033[J \n")
|
||||
|
||||
#define QUERYMAX 40
|
||||
#define XMAX 40
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
#include "head.h"
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
if(argc < 2){
|
||||
printf("Not enough arguments. (-help)\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int query[QUERYMAX];
|
||||
int assist[QUERYMAX];
|
||||
int inquery;
|
||||
int x[XMAX];
|
||||
for (int i = 0;i<XMAX;i++)x[i]=0;
|
||||
for (int i = 0;i<QUERYMAX;i++)assist[i]=0;
|
||||
|
||||
|
||||
if(str(argv[1],"-help")||str(argv[1],"-h")){
|
||||
printf("\nHelpMenu");
|
||||
printf("\n\tprog [arg1] [arg2] [arg3]");
|
||||
printf("\n\t[arg1] - Block of func");
|
||||
printf("\n\t[arg2] - Func num");
|
||||
printf("\n\t[arg3] - Func input");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc < 3){
|
||||
printf("Not enough arguments. (-help)\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int swt=0;
|
||||
if(((int)*argv[1])>='1' && ((int)*argv[1])<='3'){
|
||||
swt = ((int)*argv[1]) - '0';
|
||||
}
|
||||
else{
|
||||
printf("Wrong [arg1]\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(((int)*argv[2])>='0' && ((int)*argv[2])<='9'){
|
||||
switch(swt){
|
||||
case 1:
|
||||
while(queryinput(x,&inquery,query)!=-1)
|
||||
func1(argv,x,inquery,query);
|
||||
x[32]=1;
|
||||
func1(argv,x,inquery,query);
|
||||
break;
|
||||
case 2:
|
||||
while(queryinput(x,&inquery,query)!=-1)
|
||||
func2(argv,x,inquery,query,assist);
|
||||
x[32]=1;
|
||||
func2(argv,x,inquery,query,assist);
|
||||
break;
|
||||
case 3:
|
||||
while(queryinput(x,&inquery,query)!=-1)
|
||||
func3(argv,x,inquery,query);
|
||||
break;
|
||||
}
|
||||
printcount(x);
|
||||
}
|
||||
else{
|
||||
printf("Wrong [arg2]\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
Бог помочь вам, друзья мои,
|
||||
В заботах жизни, царской службы,
|
||||
И на пирах разгульной дружбы,
|
||||
И в сладких таинствах любви!
|
||||
Бог помочь вам, друзья мои,
|
||||
И в бурях, и в житейском горе,
|
||||
В краю чужом, в пустынном море
|
||||
И в мрачных пропастях земли!
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
Средняя длинна слова - 2
|
||||
Statistic
|
||||
"Symb" - [ammount]
|
||||
|
||||
"Letters" - [33]
|
||||
"Digits" - [0]
|
||||
"\n" - [2]
|
||||
"\t" - [0]
|
||||
"space" - [12]
|
||||
other - [0]
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
Колл-во букв после 1 и до последнего слова - 181
|
||||
Statistic
|
||||
"Symb" - [ammount]
|
||||
|
||||
"Letters" - [184]
|
||||
"Digits" - [0]
|
||||
"\n" - [8]
|
||||
"\t" - [0]
|
||||
"space" - [35]
|
||||
other - [12]
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
|
||||
Statistic
|
||||
"Symb" - [ammount]
|
||||
|
||||
"Letters" - [184]
|
||||
"Digits" - [0]
|
||||
"\n" - [8]
|
||||
"\t" - [0]
|
||||
"space" - [35]
|
||||
other - [12]
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
2164 171614162530 3114 5182193033 141610
|
||||
3 9121620123 71091510 2411819121611 1913217229
|
||||
10 151 171018123 18194211330151611 518217229
|
||||
10 3 191315121023 201101519203123 13322310
|
||||
2164 171614162530 3114 5182193033 141610
|
||||
10 3 221183323 10 3 7102061119121614 416186
|
||||
3 1218132 252171614 3 172119202915151614 1416186
|
||||
10 3 1418125152923 17181617119203323 96141310
|
||||
|
||||
Statistic
|
||||
"Symb" - [ammount]
|
||||
|
||||
"Letters" - [184]
|
||||
"Digits" - [0]
|
||||
"\n" - [8]
|
||||
"\t" - [0]
|
||||
"space" - [35]
|
||||
other - [46]
|
||||
@@ -0,0 +1,2 @@
|
||||
Привет Пока как дела я тебя не знаю
|
||||
а б в г д
|
||||
@@ -0,0 +1,3 @@
|
||||
../prog 1 3 < AP_19_10_1827.txt > output.1_3
|
||||
../prog 2 8 < AP_19_10_1827.txt > output.2_8
|
||||
../prog 3 4 < AP_19_10_1827.txt > output.3_4
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
gcc -Wall main.c ./func.c -o prog
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
Denton,Strong,0,6
|
||||
Magee,Avila,2,8
|
||||
Leilani,Wade,2,1
|
||||
Oren,Guerra,4,5
|
||||
Nevada,Clayton,4,8
|
||||
Halee,Lynn,3,8
|
||||
Jocelyn,Knight,4,6
|
||||
Patrick,Sullivan,6,6
|
||||
Cyrus,Barlow,8,1
|
||||
Matthew,Vaughn,7,4
|
||||
|
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#ifndef HEAD
|
||||
#define HEAD
|
||||
|
||||
// INCLUDE
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
||||
// DEFINE
|
||||
#define MAXSYMB_IN_NAME 15
|
||||
#define MAXSYMB_IN_SURNAME 20
|
||||
|
||||
#define MAXSYMB_IN_CURROW 20 // SHOOD BE >= THAN MAXSYMB* AND CANNOT BE > 255
|
||||
|
||||
#define MAXSTUDENTS 10 // SHOOD BE > 255
|
||||
|
||||
|
||||
#define clear wchar_t clear[] = L"\n \033[H\033[J \n"; for(int i = 0;clear[i]!='\0';i++)putwchar(clear[i])
|
||||
|
||||
// FUNC
|
||||
// === output.c ===
|
||||
void print_menu_main(void);
|
||||
void print_wich_student(void);
|
||||
void print_menu_create(char ws);
|
||||
void print_menu_edit(char ws);
|
||||
void print_menu_del(char ws);
|
||||
void print_no_free_space(void);
|
||||
|
||||
// === input.c ===
|
||||
char get_num(void);
|
||||
void get_row(wchar_t row[]);
|
||||
|
||||
// === logic.c ===
|
||||
|
||||
#endif
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#include "head.h"
|
||||
|
||||
char get_num(void){
|
||||
char ws;
|
||||
do{
|
||||
wchar_t ch; ws = 0;
|
||||
while((ch=getwchar())>='0'&&ch<='9')
|
||||
ws = (ws*10) + (ch-'0');
|
||||
}while(ws==0);
|
||||
return ws;
|
||||
}
|
||||
|
||||
void get_row(wchar_t row[]){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#include "head.h"
|
||||
|
||||
int main(void){
|
||||
setlocale(LC_ALL, "");
|
||||
struct structStudentList{
|
||||
wchar_t _name[MAXSYMB_IN_NAME+1];
|
||||
wchar_t _surname[MAXSYMB_IN_SURNAME+1];
|
||||
char age;
|
||||
char curse;
|
||||
};
|
||||
|
||||
struct structStudentList students[MAXSTUDENTS+1];
|
||||
|
||||
char count_acc[MAXSTUDENTS+1];
|
||||
{
|
||||
for (int i = 0; i<MAXSTUDENTS;i++)
|
||||
count_acc[i] = i;
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t _currrow[MAXSYMB_IN_CURROW+1];
|
||||
char flag = 0;
|
||||
do{ // Main Menu
|
||||
clear;
|
||||
print_menu_main();
|
||||
flag = get_num();
|
||||
char sw = 0;
|
||||
char status;
|
||||
switch(flag){
|
||||
case 1:
|
||||
{ // Crete acc
|
||||
if(count_acc[MAXSTUDENTS]==0){
|
||||
print_no_free_space();
|
||||
}
|
||||
else{
|
||||
print_menu_create(*count_acc);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{ // Edit acc
|
||||
print_wich_student();
|
||||
|
||||
sw = get_num();
|
||||
if(sw==-1)return 0;
|
||||
|
||||
status = 0;
|
||||
|
||||
for(int i = 0;i<MAXSTUDENTS;i++){
|
||||
status = sw == count_acc[i]?1:0;
|
||||
if(status) break;
|
||||
}
|
||||
|
||||
if(status){
|
||||
print_acc_not_exist();
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{ // Del acc
|
||||
print_wich_student();
|
||||
sw = get_num();
|
||||
if(sw==-1)return 0;
|
||||
|
||||
status = 0;
|
||||
for(int i = 0;i<MAXSTUDENTS;i++){
|
||||
status = sw == count_acc[i]?1:0;
|
||||
if(status) break;
|
||||
}
|
||||
|
||||
if(status){
|
||||
print_acc_not_exist();
|
||||
}
|
||||
else{
|
||||
del_acc(sw);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}while(flag);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
#include "head.h"
|
||||
|
||||
void print_menu_main(void){
|
||||
wchar_t word[] =
|
||||
L"\n\tМЕНЮ управления учетными запясями студентов\n 1 - Создать учетку\n2 - Редактировать учетку\n3 - Удалить учетку\n4 - Посмотреть все учетки\n";
|
||||
for(int i = 0;word[i]!='\0';i++){
|
||||
putwchar(word[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void print_wich_student(void){
|
||||
wchar_t word[] =
|
||||
L"\nВведите № учетной записи: ";
|
||||
for(int i = 0;word[i]!='\0';i++){
|
||||
putwchar(word[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void print_menu_create(char ws){
|
||||
wchar_t word[] =
|
||||
L"\n\tМЕНЮ создания учетной записи";
|
||||
for(int i = 0;word[i]!='\0';i++){
|
||||
putwchar(word[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void print_menu_edit(char ws){
|
||||
wchar_t word[] =
|
||||
L"\n\tМЕНЮ редактирования учетной записи\n";
|
||||
for(int i = 0;word[i]!='\0';i++){
|
||||
putwchar(word[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void print_menu_del(char ws){
|
||||
{//Print first part of sentense
|
||||
wchar_t word[] =
|
||||
L"\nВы уверенны что хотите удалить учетку № ";
|
||||
for(int i = 0;word[i]!='\0';i++){
|
||||
putwchar(word[i]);
|
||||
}
|
||||
}
|
||||
|
||||
{//Print №
|
||||
char method = ws>=10?(ws>=100?3:2):1;
|
||||
char num[3];
|
||||
for (int i = 0;i<method;i++){
|
||||
num[i] = ws%10;
|
||||
ws /= 10;
|
||||
}
|
||||
|
||||
for (int i = method-1;i>=0;i--){
|
||||
putwchar(num[i]);
|
||||
}
|
||||
}
|
||||
|
||||
{//Print last part of sentense
|
||||
wchar_t word2[] =
|
||||
L" ?\n";
|
||||
for(int i = 0;word2[i]!='\0';i++){
|
||||
putwchar(word2[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void print_list(void){
|
||||
wchar_t word[] =
|
||||
L"\t";
|
||||
for(int i = 0;word[i]!='\0';i++){
|
||||
putwchar(word[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
char l[26];
|
||||
|
||||
for (int i = 0; i < 26; ++i) {
|
||||
l[i] = 'a' + i;
|
||||
}
|
||||
printf("t-t: ");
|
||||
for (int i = 0; i < 26; ++i) {
|
||||
printf("%c ", l[i]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
long int sum, min, max;
|
||||
|
||||
printf("min max: ");
|
||||
scanf("%ld %ld", &min, &max);
|
||||
|
||||
while(min < max){
|
||||
sum = 0;
|
||||
for(;min <= max; ++min)
|
||||
sum += (min*min);
|
||||
printf("Result: %ld\nmin max: ",sum);
|
||||
scanf("%ld %ld", &min, &max);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int n[8];
|
||||
for (int i = 0; i < 8; i++){
|
||||
printf("num %d: ",i);
|
||||
scanf("%d", &n[i]);
|
||||
}
|
||||
for (int i = 7; i > 0; --i)
|
||||
printf("%d ", n[i]);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int s, n;
|
||||
double s1, s2;
|
||||
|
||||
scanf("%d", &n);
|
||||
while(n > 0) {
|
||||
s1 = s2 = 0.0;
|
||||
s = 1;
|
||||
for(int i = 1; i <= n; i++) {
|
||||
s1 += 1.0 / i;
|
||||
s2 += s * (1.0 / i);
|
||||
s *= -1;
|
||||
}
|
||||
printf("summ1 = %lf\nsumm2 = %lf\nNum: ",s1,s2);
|
||||
scanf("%d", &n);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int x = 2, m[9];
|
||||
for(int i = 0; i < 8; ++i){
|
||||
for(int k = 0; k < i; ++k)
|
||||
x *= 2;
|
||||
m[i] = x;
|
||||
x = 2;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
do{
|
||||
printf("%d\n",m[i]);
|
||||
i++;
|
||||
}while(i < 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
double a[8], b[8], sum = 0.0;
|
||||
for (int i = 0; i < 8; ++i){
|
||||
printf("num %d: ",i);
|
||||
scanf("%lf", &a[i]);
|
||||
sum += a[i];
|
||||
b[i] = sum;
|
||||
}
|
||||
for (int i = 0; i < 8; ++i)
|
||||
printf("%.3lf ", a[i]);
|
||||
printf("\n");
|
||||
for (int i = 0; i < 8; ++i)
|
||||
printf("%.3lf ", b[i]);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
||||
int main() {
|
||||
setlocale(LC_ALL, "");
|
||||
wchar_t s[256];
|
||||
wchar_t c;
|
||||
int n = 0, st = 0;
|
||||
|
||||
while(st == 0){
|
||||
wscanf(L"%lc", &c);
|
||||
st = (c == '\n');
|
||||
s[n] = c;
|
||||
n = n + (1 - st);
|
||||
}
|
||||
|
||||
while(n > 0) {
|
||||
n -= 1;
|
||||
wprintf(L"%lc", s[n]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
float a,b,x;
|
||||
int c = 0;
|
||||
a = b = x = 100;
|
||||
do{
|
||||
a += (x * 0.10);
|
||||
b += (b * 0.05);
|
||||
c++;
|
||||
}while(a >= b);
|
||||
printf("dafna: %.3f\ndeind: %.3f\nyear: %d",a,b,c);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int sum = 1000000;
|
||||
int take = 100000;
|
||||
float proc = 0.08;
|
||||
int y = 0;
|
||||
do{
|
||||
y++;
|
||||
sum -= take;
|
||||
sum += (sum * proc);
|
||||
}while(sum >= 0);
|
||||
|
||||
printf("%d",y);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int d = 5;
|
||||
int max = 150;
|
||||
int n = 0;
|
||||
do{
|
||||
printf("%d %d\n",d,n);
|
||||
n++;
|
||||
d -= n;
|
||||
d *= 2;
|
||||
}while(d <= max);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int r = 5;
|
||||
for (int i = 1; i <= r; ++i) {
|
||||
for (int c = 0; c < i; ++c) {
|
||||
printf("$");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int r = 6;
|
||||
char l;
|
||||
for (int i = 1; i <= r; ++i) {
|
||||
l = 'F';
|
||||
for (int j = 0; j < i; ++j) {
|
||||
printf("%c", l);
|
||||
l -= 1;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int r = 6;
|
||||
char l[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
int rev = 5;
|
||||
for (int i = 1; i <= r; ++i) {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
printf("%c", l[rev - j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int r = 6;
|
||||
char l = 'A';
|
||||
for(int i = 1; i <= r; ++i) {
|
||||
for(int j = 0; j < i; ++j){
|
||||
printf("%c",l);
|
||||
l += 1;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int r = 0;
|
||||
char l, x;
|
||||
scanf("%c", &x);
|
||||
|
||||
for(char z = 'A'; z <= x; ++z)
|
||||
r++;
|
||||
for(int i = 1; i <= r; ++i){
|
||||
l = 'A';
|
||||
|
||||
for(int j = 0; j < r - i; ++j){
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
for(int j = 0; j < i; ++j){
|
||||
printf("%c", l);
|
||||
l++;
|
||||
}
|
||||
l -= 2;
|
||||
for(int j = 0; j < i - 1; ++j){
|
||||
printf("%c", l);
|
||||
l--;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int b, t;
|
||||
|
||||
printf("bottom: ");
|
||||
scanf("%d", &b);
|
||||
printf("top: ");
|
||||
scanf("%d", &t);
|
||||
|
||||
for(;b <= t; ++b){
|
||||
printf("\n%d\t%d\t%d",b,(b*b),(b*b*b));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
||||
int main(){
|
||||
setlocale(LC_ALL, "");
|
||||
wchar_t ch[40];
|
||||
|
||||
wscanf(L"%ls", ch);
|
||||
size_t len = wcslen(ch);
|
||||
for (int i = len - 1; i >= 0; --i) {
|
||||
wprintf(L"%lc", ch[i]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
float a,b;
|
||||
int s;
|
||||
printf("a b: ");
|
||||
s = scanf("%f %f", &a, &b);
|
||||
while (s == 2){
|
||||
printf("%.3f / %.3f = %.3f\na b: ",a-b,a+b,((a-b)/(a+b)));
|
||||
s = scanf("%f %f", &a, &b);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
int x(float a, float b);
|
||||
|
||||
int main(){
|
||||
float a,b;
|
||||
int s;
|
||||
printf("a b: ");
|
||||
s = scanf("%f %f", &a, &b);
|
||||
while (s == 2){
|
||||
x(a,b);
|
||||
printf("a b: ");
|
||||
s = scanf("%f %f", &a, &b);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int x (float a, float b){
|
||||
printf("%.3f / %.3f = %.3f\n",a-b,a+b,((a-b)/(a+b)));
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int ch,sp,n,s;
|
||||
sp = n = s = 0;
|
||||
while((ch = getchar())!='#'){
|
||||
switch(ch){
|
||||
case ' ': n++; break;
|
||||
case '\n': sp++; break;
|
||||
default: s++; break;
|
||||
}}
|
||||
printf("spaces: %d\tnewln: %d\tsymb: %d\n",sp,n,s);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define n1 0.15 //tax1
|
||||
#define n2 0.28
|
||||
|
||||
#define m1 17850
|
||||
#define m2 23900
|
||||
#define m3 29750
|
||||
#define m4 14875
|
||||
|
||||
|
||||
int main() {
|
||||
int m,sw,swt,exit;
|
||||
float d,tax;
|
||||
exit = swt = 1;
|
||||
while(exit){
|
||||
do{
|
||||
printf("Choose tarif:\n");
|
||||
printf("1) odin\t2) main\n");
|
||||
printf("3) brak sov\t4) Brak razd\n");
|
||||
printf("5) exit\nInput: ");
|
||||
sw = getchar();
|
||||
switch(sw){
|
||||
case '1': m = m1; swt = 0; break;
|
||||
case '2': m = m2; swt = 0; break;
|
||||
case '3': m = m3; swt = 0; break;
|
||||
case '4': m = m4; swt = 0; break;
|
||||
case '5': exit = 0; break;
|
||||
}
|
||||
}while(swt&&exit);
|
||||
if(exit){
|
||||
printf("dohod: ");
|
||||
scanf("%f",&d);
|
||||
while(getchar() != '\n');
|
||||
|
||||
if (d>m){tax = ((m*n1)+((d-m)*n2));}
|
||||
else (tax = (d*n1));
|
||||
|
||||
printf("Tax: %.2f\n\n\n",tax);
|
||||
}}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define arti 2.05
|
||||
#define svek 1.15
|
||||
#define carr 1.09
|
||||
|
||||
#define skid 0.05
|
||||
|
||||
#define zatrporog1 5
|
||||
#define zatrporog2 20
|
||||
#define zatrmin 6.50
|
||||
#define zatrsr 14.00
|
||||
#define zatrmax 0.5
|
||||
|
||||
int main() {
|
||||
int ch,a,s,c,tmp;
|
||||
float sk,st,zt;
|
||||
|
||||
printf("a - Artishok\nb - Svek\nc -Carrot\nq - quit\nInput: ");
|
||||
while((ch = getchar())!='q'){
|
||||
switch(ch){
|
||||
case 'a':
|
||||
printf("Arti: ");
|
||||
scanf("%d",&tmp);
|
||||
a+=tmp;
|
||||
break;
|
||||
case 'b':
|
||||
printf("svek: ");
|
||||
scanf("%d",&tmp);
|
||||
s+=tmp;
|
||||
break;
|
||||
case 'c':
|
||||
printf("Carrot: ");
|
||||
scanf("%d",&tmp);
|
||||
c+=tmp;
|
||||
break;
|
||||
}
|
||||
printf("\n\nzakaz:\nArti\tSvek\tCarrot\n%d\t%d\t%d\n",a,s,c);
|
||||
printf("a - Artishok\nb - Svek\nc - Carrot\nq - deal\nInput: ");
|
||||
}
|
||||
|
||||
if((a>0)||(s>0)||(c>0)){
|
||||
|
||||
st = ((a*arti)+(s*svek)+(c*carr));
|
||||
tmp = (a+s+c);
|
||||
if(tmp>zatrporog1){
|
||||
if(tmp>zatrporog2){
|
||||
zt=(zatrsr+((tmp-zatrporog2)*zatrmax));
|
||||
}else(zt=zatrsr);
|
||||
}else(zt=zatrmin);
|
||||
if(st>100){sk=(st+zt)*skid;}
|
||||
|
||||
printf("zakaz: arti-%d Svek-%d Carr-%d\n",a,s,c);
|
||||
printf("Arti-%d sum-%0.2f stoimost-%0.2f/1\n",a,a*arti,arti);
|
||||
printf("Svek-%d sum-%0.2f stoimost-%0.2f/1\n",s,s*svek,svek);
|
||||
printf("Carrot-%d sum-%0.2f stoimost-%0.2f/1\n",c,c*carr,carr);
|
||||
printf("stoimost-%.2f skidka-%.2f zatrat-%.2f\nitogo: %.2f",st,sk,zt,zt+st-sk);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int ch,c,m[8];
|
||||
ch = c = 0;
|
||||
printf("ascii symb - its num until #\n");
|
||||
while((ch = getchar()) != '#'){
|
||||
m[c] = ch;
|
||||
c++;
|
||||
if(c == 8){
|
||||
for(c = 0; c < 8; c++){
|
||||
switch(m[c]){
|
||||
case '\n':
|
||||
printf("\\n - %d ",m[c]);
|
||||
break;
|
||||
case ' ':
|
||||
printf("\"%c\" - %d ",m[c],m[c]);
|
||||
break;
|
||||
default:
|
||||
printf("%c - %d ",m[c],m[c]);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
c = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int a,n1,sum1,n2,sum2;
|
||||
n1 = sum1 = n2 = sum2 = 0;
|
||||
printf("num: ");
|
||||
a = 1;
|
||||
while(scanf("%d", &a) && a != 0){
|
||||
if (a % 2 == 0){n1++; sum1 += a;}
|
||||
else ({n2++; sum2 += a;});
|
||||
printf("num: ");
|
||||
}
|
||||
printf("eve nums: %d \t eve summ: %d \t mean: %d\n",n1,sum1,(sum1/n1));
|
||||
printf("odd nums: %d \t odd summ: %d \t mean: %d",n2,sum2,(sum2/n2));
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int ch,r;
|
||||
r = 0;
|
||||
printf("Print something:\n");
|
||||
while((ch = getchar()) != '#'){
|
||||
if(ch == '!'){r++;putchar('!');putchar('!');}
|
||||
else if(ch == '.'){r++;putchar('!');}
|
||||
else putchar(ch);
|
||||
}
|
||||
printf("\nr: %d",r);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int ch,r;
|
||||
r = 0;
|
||||
printf("Print something:\n");
|
||||
while((ch = getchar()) != '#'){
|
||||
switch(ch){
|
||||
case '!': r++;putchar('!');putchar('!');break;
|
||||
case '.': r++;putchar('!');break;
|
||||
default : putchar(ch);
|
||||
}
|
||||
}
|
||||
printf("\nr: %d",r);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int a,b,c;
|
||||
a = b = c = 0;
|
||||
printf("count ei:\n");
|
||||
while((a = getchar()) != '#'){
|
||||
if(a == 'i' && b == 'e'){c++;}
|
||||
b = a;
|
||||
}
|
||||
printf("count: %d",c);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#define t 10 //zp
|
||||
#define s 40 //sverh
|
||||
#define u 1.5 //sverh*
|
||||
#define n1 0.15 //tax1
|
||||
#define n2 0.2
|
||||
#define n3 0.25
|
||||
#define m1 300 //maxbeftax2
|
||||
#define m2 150
|
||||
|
||||
|
||||
int main() {
|
||||
int h,tax,a;
|
||||
printf("hours: ");
|
||||
scanf("%d",&h);
|
||||
|
||||
if (h>s){tax = a = (s*t + ((h-s) * (t*u)));}
|
||||
else(tax = a = h*t);
|
||||
|
||||
if (tax>m1)
|
||||
{
|
||||
if(tax>m2){tax = (m1*n1) + (m2*n2) + ((tax-m1-m2)*n3);}
|
||||
else(tax = (m1*n1) + ((tax-m1)*n2));
|
||||
}
|
||||
else (tax*=n1);
|
||||
|
||||
printf("Acc: %d\nTax: %d\nReceived: %d",a,tax,a-tax);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#include <stdio.h>
|
||||
#define t1 8.75
|
||||
#define t2 9.33
|
||||
#define t3 10.00
|
||||
#define t4 11.20
|
||||
// #define t 10 //zp
|
||||
#define s 40 //sverh
|
||||
#define u 1.5 //sverh*
|
||||
#define n1 0.15 //tax1
|
||||
#define n2 0.2
|
||||
#define n3 0.25
|
||||
#define m1 300 //maxbeftax2
|
||||
#define m2 150
|
||||
|
||||
int main() {
|
||||
int h,sw,x,swt,exit,scan;
|
||||
float t,tax,a;
|
||||
exit = x = swt = scan = 1;
|
||||
while(exit){
|
||||
printf("hours: ");
|
||||
scanf("%d", &h);
|
||||
while (getchar() != '\n');
|
||||
do{
|
||||
printf("Choose tarif:\n");
|
||||
printf("1) $%.2f/h\t2) $%.2f/h\n",t1,t2);
|
||||
printf("3) $%.2f/h\t4) $%.2f/h\n",t3,t4);
|
||||
printf("5) exit\nInput: ");
|
||||
sw = getchar();
|
||||
switch(sw){
|
||||
case '1': t = t1; swt = 0; break;
|
||||
case '2': t = t2; swt = 0; break;
|
||||
case '3': t = t3; swt = 0; break;
|
||||
case '4': t = t4; swt = 0; break;
|
||||
case '5': exit = 0; break;
|
||||
}
|
||||
}while(swt&&exit);
|
||||
|
||||
if(!swt && exit){
|
||||
if (h>s){tax = a = (s*t + ((h-s) * (t*u)));}
|
||||
else(tax = a = h*t);
|
||||
|
||||
if (tax>m1)
|
||||
{
|
||||
if(tax>m2){tax = (m1*n1) + (m2*n2) + ((tax-m1-m2)*n3);}
|
||||
else(tax = (m1*n1) + ((tax-m1)*n2));
|
||||
}
|
||||
else (tax*=n1);
|
||||
printf("Acc: %.3f\nTax: %.3f\nReceived: %.3f\n",a,tax,a-tax);
|
||||
}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
int pr(long long n);
|
||||
|
||||
int main() {
|
||||
long long int x,i;
|
||||
printf("Num: ");
|
||||
if(!(scanf("%lld",&x)))return 1;
|
||||
|
||||
for(i = x; i > 1; --i)
|
||||
if(pr(i))
|
||||
printf("%lld\t",i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pr(long long n) {
|
||||
if (n < 2) return 0;
|
||||
if (n == 2 || n == 3) return 1;
|
||||
if (n % 2 == 0 || n % 3 == 0) return 0;
|
||||
|
||||
for (long long i = 5; i * i <= n; i += 6) {
|
||||
if (n % i == 0 || n % (i + 2) == 0)
|
||||
return 0;}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
double min(double x, double y);
|
||||
|
||||
int main(){
|
||||
double x,y;
|
||||
printf("Enter: num1 num2\nEnter: ");
|
||||
scanf("%lf %lf",&x,&y);
|
||||
printf("lower: %lf\n",min(x,y));
|
||||
return 0;
|
||||
}
|
||||
|
||||
double min(double x, double y){
|
||||
return ((x>y)?x:y);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
void to_base_n(unsigned long *n, int *b);
|
||||
|
||||
int main(void){
|
||||
unsigned long num;
|
||||
int bin;
|
||||
printf("Enter: num base(2-10)\t(q to quit):\n");
|
||||
printf("Enter: ");
|
||||
while (scanf(" %ld %d", &num, &bin) == 2){
|
||||
if(bin>1&&bin<11){
|
||||
to_base_n(&num,&bin);
|
||||
putchar('\n');
|
||||
printf("Enter: ");
|
||||
}else(printf("base is out of range\nEnter: "));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void to_base_n(unsigned long *n, int *b){
|
||||
int r;
|
||||
r = *n % *b;
|
||||
if (*n >= *b){
|
||||
*n = *n / *b;
|
||||
to_base_n(n,b);
|
||||
}
|
||||
putchar('0' + (r % *b));
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
int fibonacci(int n);
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
printf("Enter: num\nEnter: ");
|
||||
scanf("%d",&n);
|
||||
printf("fibonacci(%d) = %d",n,fibonacci(n));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fibonacci(int n){
|
||||
if(n<=0) return 0;
|
||||
if(n==1) return 1;
|
||||
int a = 0, b = 1, next;
|
||||
|
||||
for(int i = 2;i <= n;i++){
|
||||
next = a + b;
|
||||
a = b;
|
||||
b = next;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int i = 0;
|
||||
while(getchar() != EOF)
|
||||
i++;
|
||||
printf("%d",i);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int ch,c,m[10];
|
||||
ch = c = 0;
|
||||
printf("ascii symb - its num\n");
|
||||
while((ch = getchar()) != EOF){
|
||||
m[c] = ch;
|
||||
c++;
|
||||
if(c == 10){
|
||||
for(c = 0; c < 10; c++){
|
||||
switch(m[c]){
|
||||
case '\n':
|
||||
printf(" \\n - %3d ",m[c]);
|
||||
break;
|
||||
|
||||
case '\t':
|
||||
printf(" \\t - %3d ",m[c]);
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
printf("\"%c\" - %3d ",m[c],m[c]);
|
||||
break;
|
||||
|
||||
default:
|
||||
if(m[c]<' '){
|
||||
printf(" ^%c - %3d ", m[c] + 64, m[c]);
|
||||
}else
|
||||
if(m[c] == 127){
|
||||
printf(" ^? %3d ",m[c]);
|
||||
}else printf("%3c - %3d ",m[c],m[c]);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
c = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
||||
int alpha(wchar_t x);
|
||||
|
||||
int main() {
|
||||
setlocale(LC_ALL, "");
|
||||
int smol = 0,big = 0,symb = 0;
|
||||
wchar_t x;
|
||||
while((x = getwchar()) != WEOF){
|
||||
switch(alpha(x)){
|
||||
case 1: smol++;break;
|
||||
case 2: big++;break;
|
||||
default: symb++;break;
|
||||
}
|
||||
}
|
||||
printf("Пропись: %d\tСтрочных: %d\tОстальное: %d",smol,big,symb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int alpha(wchar_t x){
|
||||
if (x >= L'A' && x <= L'Z')
|
||||
return 2;
|
||||
else if (x >= L'a' && x <= L'z')
|
||||
return 1;
|
||||
else if (x >= L'А' && x <= L'Я')
|
||||
return 2;
|
||||
else if (x >= L'а' && x <= L'я')
|
||||
return 1;
|
||||
else if (x == L'Ё')
|
||||
return 2;
|
||||
else if (x == L'ё')
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
int main() {
|
||||
setlocale(LC_ALL, "");
|
||||
float ch = 0,words = 0,o = 0;
|
||||
wchar_t x;
|
||||
while((x = getwchar()) != WEOF){
|
||||
switch(x){
|
||||
case ' ':
|
||||
ch += o;
|
||||
if(o>0) words++;
|
||||
o = 0;
|
||||
break;
|
||||
default:
|
||||
o++;
|
||||
}
|
||||
}
|
||||
|
||||
printf("\nch per word - %.2f\n",ch/words);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void){
|
||||
int guess = 1,ext = 1;
|
||||
int x = 50, max = 100, min = 0;
|
||||
printf("Загадайте число 0 - 100, я буду его отгадывать\n");
|
||||
printf("Вы должны сказать, это число меньше, больше или это оно\n");
|
||||
printf("За ответ принимается только l(Меньше) b(Больше) y(Оно)\n");
|
||||
|
||||
while(ext != 0){
|
||||
printf("Это число %d?\n",x);
|
||||
ext = getchar();
|
||||
while(getchar()!='\n')
|
||||
continue;
|
||||
|
||||
switch(ext){
|
||||
case 'l':
|
||||
max = x - 1;
|
||||
x = (max+min)/2;
|
||||
guess++;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
min = x + 1;
|
||||
x = (max+min)/2;
|
||||
guess++;
|
||||
break;
|
||||
|
||||
case 'y':ext = 0;break;
|
||||
}
|
||||
if(x<0||x>100){
|
||||
printf("Вы загадали число за пределами ожиданий!\n");
|
||||
ext=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(x>=0&&x<=100)
|
||||
printf("Загаданное число - %d\t Число угадываний - %d",x,guess);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void){
|
||||
int ch;
|
||||
while((ch = getchar()) == ' ')
|
||||
continue;
|
||||
while (getchar() != '\n')
|
||||
continue;
|
||||
printf("%c",ch);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
#include <stdio.h>
|
||||
#define t1 8.75
|
||||
#define t2 9.33
|
||||
#define t3 10.00
|
||||
#define t4 11.20
|
||||
// #define t 10 //zp
|
||||
#define s 40 //sverh
|
||||
#define u 1.5 //sverh*
|
||||
#define n1 0.15 //tax1
|
||||
#define n2 0.2
|
||||
#define n3 0.25
|
||||
#define m1 300 //maxbeftax2
|
||||
#define m2 150
|
||||
|
||||
int main() {
|
||||
int h,sw,x,swt,exit,scan;
|
||||
float t,tax,a;
|
||||
exit = x = swt = scan = 1;
|
||||
while(exit){
|
||||
printf("hours: ");
|
||||
while(scanf("%d", &h)!=1){
|
||||
printf("input err\n");
|
||||
if(getchar() == EOF) return 0;
|
||||
while (getchar() != '\n') continue;
|
||||
printf("hours: ");
|
||||
}
|
||||
while (getchar() != '\n') continue;
|
||||
do{
|
||||
while (getchar() != '\n') continue;
|
||||
printf("Choose tarif:\n");
|
||||
printf("a) $%.2f/h\tb) $%.2f/h\n",t1,t2);
|
||||
printf("c) $%.2f/h\td) $%.2f/h\n",t3,t4);
|
||||
printf("q) exit\nInput: ");
|
||||
sw = getchar();
|
||||
if(getchar() == EOF){return 0;}
|
||||
while (getchar() != '\n') continue;
|
||||
switch(sw){
|
||||
case 'a': t = t1; swt = 0; break;
|
||||
case 'b': t = t2; swt = 0; break;
|
||||
case 'c': t = t3; swt = 0; break;
|
||||
case 'd': t = t4; swt = 0; break;
|
||||
case 'q': exit = 0; break;
|
||||
default: printf("input err\n");
|
||||
}
|
||||
}while(swt&&exit);
|
||||
|
||||
if(!swt && exit){
|
||||
if (h>s){tax = a = (s*t + ((h-s) * (t*u)));}
|
||||
else(tax = a = h*t);
|
||||
|
||||
if (tax>m1)
|
||||
{
|
||||
if(tax>m2){tax = (m1*n1) + (m2*n2) + ((tax-m1-m2)*n3);}
|
||||
else(tax = (m1*n1) + ((tax-m1)*n2));
|
||||
}
|
||||
else (tax*=n1);
|
||||
printf("Acc: %.3f\nTax: %.3f\nReceived: %.3f\n",a,tax,a-tax);
|
||||
}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void calc(int func);
|
||||
|
||||
int main() {
|
||||
int exit = 1,sw;
|
||||
|
||||
do{
|
||||
printf("\nВыберите операцию:\n");
|
||||
printf("a) сложение\tb) вычитание\n");
|
||||
printf("c) умножение\td) деление\n");
|
||||
printf("q) exit\nInput: ");
|
||||
sw = getchar();
|
||||
switch(sw){
|
||||
case 'a': calc(1); break;
|
||||
case 'b': calc(2); break;
|
||||
case 'c': calc(3); break;
|
||||
case 'd': calc(4); break;
|
||||
case 'q': exit = 0; break;
|
||||
|
||||
}}while(exit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void calc(int func){
|
||||
float n1,n2;
|
||||
int x;
|
||||
printf("Введите первое число: ");
|
||||
while(scanf(" %f",&n1)!=1){
|
||||
printf("То что вы ввели не является числом.\n");
|
||||
printf("Введите первое число: ");
|
||||
while(getchar()!='\n') continue;
|
||||
}
|
||||
|
||||
printf("Введите второе число: ");
|
||||
do{
|
||||
x = (scanf(" %f",&n2) != 1);
|
||||
if(x){
|
||||
printf("То что вы ввели не является числом.\n");
|
||||
printf("Введите второе число: ");
|
||||
}else
|
||||
if(n2 == 0&&func==4){
|
||||
printf("Введите число отличное от 0\n");
|
||||
printf("Введите второе число: ");
|
||||
x = 1;
|
||||
}
|
||||
while(getchar()!='\n') continue;
|
||||
}while(x);
|
||||
switch(func){
|
||||
case 1:
|
||||
printf("%f + %f = %f\n",n1,n2,n1+n2);
|
||||
break;
|
||||
case 2:
|
||||
printf("%f - %f = %f\n",n1,n2,n1-n2);
|
||||
break;
|
||||
case 3:
|
||||
printf("%f * %f = %f\n",n1,n2,n1*n2);
|
||||
break;
|
||||
case 4:
|
||||
printf("%f / %f = %f\n",n1,n2,n1/n2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
void min(char ch, char i, char j);
|
||||
|
||||
int main(){
|
||||
char ch, i, j;
|
||||
|
||||
printf("Enter: char i j\nEnter: ");
|
||||
scanf(" %c %c %c",&ch,&i,&j);
|
||||
min(ch,i,j);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void min(char ch, char i, char j){
|
||||
int c = i;
|
||||
for(;i<=j;i++){printf("%c\t",i);}
|
||||
printf("\n");
|
||||
i = c;
|
||||
for(;i<=j;i++){printf("%c\t",ch);}
|
||||
printf("\n");
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
void table(char ch, int a, int b);
|
||||
|
||||
int main(){
|
||||
char ch;
|
||||
int a,b;
|
||||
printf("Enter: Char num1 num2\nEnter: ");
|
||||
scanf(" %c %d %d",&ch,&a,&b);
|
||||
table(ch,a,b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void table(char ch, int a, int b){
|
||||
//for(int i = 0;i<=a;i++){printf("%d",i);}
|
||||
printf("\n");
|
||||
for(int i = 1;i<=b;i++){
|
||||
//printf("%d",i);
|
||||
for(int x = 1;x<=a;x++){printf("%c",ch);}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
double garmony(double a,double b);
|
||||
|
||||
int main(){
|
||||
double a, b;
|
||||
printf("Enter: num1 num2\nEnter: ");
|
||||
scanf(" %lf %lf",&a,&b);
|
||||
printf("garmony = %lf",garmony(a,b));
|
||||
return 0;
|
||||
}
|
||||
|
||||
double garmony(double a, double b){
|
||||
double x;
|
||||
a *= -1;
|
||||
b *= -1;
|
||||
x = (((a+b)/2)*-1);
|
||||
return x;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
double larger_of(double a, double b);
|
||||
|
||||
int main() {
|
||||
double a,b,c;
|
||||
printf("Print: num1 num2\nPrint: ");
|
||||
scanf(" %lf %lf",&a,&b);
|
||||
c = larger_of(a,b);
|
||||
a = c;
|
||||
b = c;
|
||||
printf("Larger value is: %lf",a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
double larger_of(double a, double b){
|
||||
return ((a>b)?a:b);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
void scale(double *a, double *b, double *c);
|
||||
|
||||
int main() {
|
||||
double a,b,c;
|
||||
printf("Print: num1 num2 num3\nPrint: ");
|
||||
scanf(" %lf %lf %lf",&a,&b,&c);
|
||||
scale(&a,&b,&c);
|
||||
printf("%lf > %lf > %lf",a,b,c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void scale(double *a, double *b, double *c){
|
||||
double result[3];
|
||||
result[0] = *a;
|
||||
result[1] = *b;
|
||||
result[2] = *c;
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int j = 0; j < 2 - i; ++j) {
|
||||
if (result[j] < result[j + 1]) {
|
||||
double tmp = result[j];
|
||||
result[j] = result[j + 1];
|
||||
result[j + 1] = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
*a = result[0];
|
||||
*b = result[1];
|
||||
*c = result[2];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
#include <locale.h>
|
||||
|
||||
int alpha(wchar_t x);
|
||||
|
||||
int main() {
|
||||
setlocale(LC_ALL, "");
|
||||
wchar_t x;
|
||||
while((x = getwchar()) != WEOF){
|
||||
if(iswalpha(x)){
|
||||
wprintf(L"%lc - %d\n",x,alpha(x));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int alpha(wchar_t x){
|
||||
if (x >= L'A' && x <= L'Z')
|
||||
return x - L'A' + 1;
|
||||
else if (x >= L'a' && x <= L'z')
|
||||
return x - L'a' + 1;
|
||||
else if (x >= L'А' && x <= L'Я')
|
||||
return x - L'А' + 1;
|
||||
else if (x >= L'а' && x <= L'я')
|
||||
return x - L'а' + 1;
|
||||
else if (x == L'Ё' || x == L'ё')
|
||||
return 7;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#include <stdio.h>
|
||||
double power(double n, int р);
|
||||
|
||||
int main(void){
|
||||
double x, xpow;
|
||||
int exp;
|
||||
|
||||
printf("Write: num pow\t(q for exit)\nWrite: ") ;
|
||||
|
||||
while (scanf(" %lf %d", &x, &exp) == 2){
|
||||
xpow = power(x,exp);
|
||||
if (xpow != 0){
|
||||
printf ("%.2lf в степени %d равно %lf\n", x, exp, xpow);}
|
||||
printf("Write: ");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
double power (double n, int p){
|
||||
if ((p == 0)&&(n == 0)){
|
||||
printf("Result of 0 in pow 0 is undefind\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((p == 0)||(n == 0)){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (p>0){
|
||||
double pow = 1;
|
||||
int i;
|
||||
for (i =1; i <= p; i++)
|
||||
pow *= n;
|
||||
return pow;
|
||||
}
|
||||
|
||||
if (p<0){
|
||||
double pow = 1;
|
||||
int i;
|
||||
for (i =1; i <= -p; i++)
|
||||
pow *= n;
|
||||
pow = (1 / pow);
|
||||
|
||||
return pow;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#include <stdio.h>
|
||||
void power(double *x, int *exp, double *xpow, int *i);
|
||||
|
||||
int main(){
|
||||
double x, xpow;
|
||||
int exp, i;
|
||||
i = 1;
|
||||
|
||||
printf("Write: num pow\t(q for exit)\nWrite: ") ;
|
||||
|
||||
while (scanf(" %lf %d", &x, &exp) == 2){
|
||||
if ((x == 0) && (exp == 0)){
|
||||
printf("Result of 0 in pow 0 is undefind\n");
|
||||
}
|
||||
else if(exp == 0){xpow = 1;}
|
||||
else({
|
||||
xpow = x;
|
||||
power(&x,&exp,&xpow,&i);
|
||||
});
|
||||
if ((x != 0)||(exp != 0)){
|
||||
printf ("%.2lf в степени %d равно %lf\n", x, exp, xpow);}
|
||||
printf("Write: ");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void power (double *x, int *exp, double *xpow, int *i){
|
||||
if(*i<*exp){
|
||||
*xpow = (*xpow * *x);
|
||||
(*i)++;
|
||||
power(x, exp, xpow, i);
|
||||
}else({
|
||||
if (*exp<0) *xpow = (1 / *xpow);
|
||||
(*i) = 1;
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
adaGz7908
|
||||
3123
|
||||
4
|
||||
234
|
||||
|
||||
.././././??'"\\\||"'xXФЫВчя312еЁ
|
||||
@@ -0,0 +1,49 @@
|
||||
#include "./func/func.h"
|
||||
|
||||
int main() {
|
||||
int enter,
|
||||
q = 1,
|
||||
massSize = 0,
|
||||
massCreated = 0,
|
||||
massive[MAXMASSIVESIZE];
|
||||
printf("Test massives and pointers\n");
|
||||
|
||||
do{
|
||||
printf("\t\tMain menu\n");
|
||||
printf("\tMassive manipulation\n");
|
||||
printf("a. SetMassiveSize\n");
|
||||
printf("b. FillMassive\n");
|
||||
printf("c. ViewMassive\n");
|
||||
printf("d. SelectFunc\n\n");
|
||||
printf("\tExit - g\n\n\n");
|
||||
enter = getchar();
|
||||
if(flush())return 1;
|
||||
switch(enter){
|
||||
case'a':case'A':
|
||||
setmass(&massSize);
|
||||
break;
|
||||
|
||||
case'b':case'B':
|
||||
if(massSize!=0){massCreated = fillmass(
|
||||
massSize,massive);flush();}
|
||||
else printf("\n\tSet massive size first.\n\n");
|
||||
break;
|
||||
|
||||
case'c':case'C':
|
||||
if(massCreated){viewmass(massSize,massive);}
|
||||
else printf("\n\tFill Massive first.\n\n");
|
||||
break;
|
||||
|
||||
case'd':
|
||||
if(massCreated){selfunc(massSize,massive);flush();}
|
||||
else printf("\n\tFill Massive first.\n\n");
|
||||
break;
|
||||
|
||||
case'g':case'G':
|
||||
q=0;break;
|
||||
|
||||
default: printf("Input Err\n\n");break;
|
||||
}
|
||||
}while(q);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
#include "func.h"
|
||||
|
||||
void find(int type, int size, int *massive){
|
||||
|
||||
int x,k,m,sum;
|
||||
switch(type){
|
||||
|
||||
case 6:
|
||||
case 8:
|
||||
for (int i = size - 1; i>=0;i--)
|
||||
if(massive[i]>0){
|
||||
printf("last positive int: ");
|
||||
printf("[%3d]\t{%p}\t%d\n",i,&massive[i],massive[i]);
|
||||
break;
|
||||
}
|
||||
printf("positive int is not found.\n");
|
||||
break;
|
||||
|
||||
|
||||
case 7:
|
||||
case 9:
|
||||
for (int i = size; i>=0;i--)
|
||||
if(massive[i]<0){
|
||||
printf("last negative int: ");
|
||||
printf("[%3d]{%p}\t%d\n",i,&massive[i],massive[i]);
|
||||
break;
|
||||
}
|
||||
printf("negative int is not found.\n");
|
||||
break;
|
||||
|
||||
|
||||
case 14:
|
||||
x=k=0;
|
||||
printf("find all modules of k\nInput: ");
|
||||
while(scanf(" %d",&k)!=1||k>size-1){
|
||||
if(k>size-1)printf("k shood be lower than %d",size);
|
||||
if(flush())return;
|
||||
}
|
||||
if(flush())return;
|
||||
for(int i = 0; i<size;i++){
|
||||
if(massive[i]%k==0){
|
||||
printf("[%3d]{%p}\t%d\n",i,&massive[i],massive[i]);x++;}
|
||||
}
|
||||
printf("Num of modules - %d",x);
|
||||
break;
|
||||
|
||||
|
||||
case 15:
|
||||
x=0;k=1;m=0;
|
||||
for(int i = 0;i<size-1;i++){
|
||||
for(int j = i+1;j<size-1;j++){
|
||||
if(massive[i] == massive[j]){
|
||||
k=i;
|
||||
m=j;
|
||||
break;}
|
||||
}
|
||||
if (k==m)break;
|
||||
}
|
||||
for(int i = k;i<m;i++)
|
||||
x++;
|
||||
|
||||
if(k==m)
|
||||
printf("elements between [%d] and [%d] - %d",k,m,x);
|
||||
else printf("Error same elements not found!\n");
|
||||
break;
|
||||
|
||||
case 19:
|
||||
case 21:
|
||||
case 23:
|
||||
sum=0;
|
||||
printf("find all int that lower k\nInput: ");
|
||||
while(scanf(" %d",&k)!=1){
|
||||
if(flush())return;
|
||||
}
|
||||
if(flush())return;
|
||||
for(int i = 0; i<size;i++){
|
||||
if(k<massive[i]){
|
||||
if(type != 21)
|
||||
printf("[%3d]{%p}\t%d\n",i,&massive[i],massive[i]);
|
||||
x++;
|
||||
sum+=massive[i];
|
||||
}
|
||||
}
|
||||
if(type == 21)printf("summ - %d\n",sum);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
case 22:
|
||||
case 24:
|
||||
sum=0;
|
||||
printf("find all int higher lower k\nInput: ");
|
||||
while(scanf(" %d",&k)!=1){
|
||||
if(flush())return;
|
||||
}
|
||||
if(flush())return;
|
||||
for(int i = 0; i<size;i++){
|
||||
if(k>massive[i]){
|
||||
if(type != 21)
|
||||
printf("[%3d]{%p}\t%d\n",i,&massive[i],massive[i]);
|
||||
x++;
|
||||
sum+=massive[i];
|
||||
}
|
||||
}
|
||||
if(type == 21)printf("summ - %d\n",sum);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
case 27:
|
||||
case 29:
|
||||
sum=0;
|
||||
printf("find all int higher lower mean\nInput: ");
|
||||
for(int i = 0; i<size;i++){
|
||||
sum +=massive[i];
|
||||
x++;
|
||||
}
|
||||
k = sum/x;
|
||||
x = sum = 0;
|
||||
for(int i = 0; i<size;i++){
|
||||
if(k>massive[i]){
|
||||
if(type != 21)
|
||||
printf("[%3d]{%p}\t%d\n",i,&massive[i],massive[i]);
|
||||
x++;
|
||||
sum+=massive[i];
|
||||
}
|
||||
}
|
||||
if(type == 29)printf("summ - %d\n",sum);
|
||||
break;
|
||||
|
||||
case 26:
|
||||
case 28:
|
||||
case 30:
|
||||
sum=0;
|
||||
printf("find all int higher lower mean\nInput: ");
|
||||
for(int i = 0; i<size;i++){
|
||||
sum +=massive[i];
|
||||
x++;
|
||||
}
|
||||
k = sum/x;
|
||||
x = sum = 0;
|
||||
for(int i = 0; i<size;i++){
|
||||
if(k<massive[i]){
|
||||
if(type != 21)
|
||||
printf("[%3d]{%p}\t%d\n",i,&massive[i],massive[i]);
|
||||
x++;
|
||||
sum+=massive[i];
|
||||
}
|
||||
}
|
||||
if(type == 30)printf("summ - %d\n",sum);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef FUNC
|
||||
#define FUNC
|
||||
|
||||
#include <stdio.h>
|
||||
#define MAXMASSIVESIZE 10000
|
||||
|
||||
|
||||
void setmass(int *massSize);
|
||||
int fillmass(int massSize, int *massive);
|
||||
void viewmass(int massSize, int *massive);
|
||||
void selfunc(int size, int *massive);
|
||||
int flush(void);
|
||||
|
||||
void range(int type,int size, int *massive);
|
||||
void find(int type,int size, int *massive);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,148 @@
|
||||
#include "func.h"
|
||||
|
||||
void setmass(int *massSize){
|
||||
printf("\t\tSetMassiveSize\n");
|
||||
printf("Set Massive Size - input integer\n");
|
||||
printf("Exit from this menu - input 0\n\n\n");
|
||||
printf("Input: ");
|
||||
int n;
|
||||
while(scanf(" %d",&n)!=1||n>MAXMASSIVESIZE){
|
||||
if(flush())return;
|
||||
flush();
|
||||
if(n>10000)printf("Input cannot be >%d",MAXMASSIVESIZE);
|
||||
printf("Input Err\nInput: ");
|
||||
}
|
||||
|
||||
flush();
|
||||
|
||||
if(n==0)
|
||||
return;
|
||||
else
|
||||
*massSize = n;
|
||||
return;
|
||||
}
|
||||
|
||||
int fillmass(int size, int *massive){
|
||||
printf("\t\tFill Massive\n");
|
||||
printf("You can devide elements with space or enter.\n");
|
||||
printf("You also can decide to from which element start with e.\n");
|
||||
printf("To exit input g.\n\n\n");
|
||||
printf("Input: ");
|
||||
|
||||
|
||||
int x, i, e1,e = 0, p=-1, minus = 0;
|
||||
|
||||
for(i = 0;i < size;i++){
|
||||
if(i<0)i=0;
|
||||
e1 = e = massive[i] = 0;
|
||||
while(((x = getchar()) != '\n' && x !=' '
|
||||
&& x != EOF && x != 4)
|
||||
&& ((x>='0' && x<='9')
|
||||
|| x == 'e' || (x == '-' && e==0 && massive[i]==0)))
|
||||
{
|
||||
if (x == 'e')e1=1;
|
||||
else if (x == '-')minus=1;
|
||||
|
||||
else if (e1) e = (e*10)+(x-'0');
|
||||
else massive[i] = (massive[i]*10) + (x-'0');
|
||||
}
|
||||
|
||||
if(x == EOF || x == 3){return 0;}
|
||||
if(e1&&minus)minus=0;
|
||||
if(minus && (x == '\n' || x == ' ')){minus = 0; massive[i]*=-1;}
|
||||
if(e>size) {printf("e is out of range.\n");i=p;}
|
||||
else if(e1) {i = e - 1;putchar('\n');}
|
||||
if(x == 'g'){return 1;}
|
||||
if((x<='0' && x>='9')||x==' '||x=='\n'||x<=32);
|
||||
else {
|
||||
while((x=getchar())!='\n'&&x!=' '&&x!=EOF&&x!=4);
|
||||
i--;
|
||||
printf("ErrInput\n");}
|
||||
if(p!=i&&e1!=1)
|
||||
printf("Massive - [%d]\t%d\n",i,massive[i]);
|
||||
p=i;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void viewmass(int size, int *massive){
|
||||
printf("\t\tView Massive\n");
|
||||
for(int i = 0; i < size; i++){
|
||||
printf(" | [%6d]\t%p\t%d\n",i,&massive[i],massive[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void selfunc(int size, int *massive){
|
||||
printf("\t\tFunctions\t(my - 7|16|24)\n");
|
||||
|
||||
printf("\tRange Operations\n");
|
||||
printf("2. Find Max Range\n");
|
||||
printf("3. Find Min Range\n");
|
||||
printf("10. Sum Range\n");
|
||||
printf("11. Average Range\n");
|
||||
printf("18. Diff Min Max Range\n\n");
|
||||
|
||||
printf("\tValue Search\n");
|
||||
printf("6. Find Last Positive\n");
|
||||
printf("7. Find Last Negative\n\n");
|
||||
|
||||
printf("\tIndex Search\n");
|
||||
printf("8. Find Last Positive Index\n");
|
||||
printf("9. Find Last Negative Index\n");
|
||||
printf("13. Find Indices Between\n");
|
||||
printf("17. Find Indices Value Range\n\n");
|
||||
|
||||
printf("\tValue Filtering\n");
|
||||
printf("4. Find Indices Above\n");
|
||||
printf("5. Find Indices Below\n");
|
||||
printf("19. Count Below Value\n");
|
||||
printf("20. Count Above Value\n");
|
||||
printf("21. Sum Below Value\n");
|
||||
printf("22. Sum Above Value\n");
|
||||
printf("23. Find Indices Below Value\n");
|
||||
printf("24. Find Indices Above Value\n\n");
|
||||
|
||||
printf("\tAverage Comparisons\n");
|
||||
printf("25. Count Above Average\n");
|
||||
printf("26. Count Below Average\n");
|
||||
printf("27. Find Indices Below Average\n");
|
||||
printf("28. Find Indices Above Average\n");
|
||||
printf("29. Sum Below Average\n");
|
||||
printf("30. Sum Above Average\n\n");
|
||||
|
||||
printf("\tSpecial Conditions\n");
|
||||
printf("1. Find Min Max\n");
|
||||
printf("12. Average Range\n");
|
||||
printf("14. Count Multiples\n");
|
||||
printf("15. Count Between Equals\n");
|
||||
printf("16. Sum Value Range\n\n");
|
||||
|
||||
printf("\tExit - 0\n");
|
||||
|
||||
int n;
|
||||
while(scanf(" %d",&n)!=0){
|
||||
if(flush())return;
|
||||
if (n == 0) return;
|
||||
if (n == 1 || n == 2 || n == 3 || n == 4 || n == 5 ||
|
||||
n == 10 || n == 11 || n == 12 || n == 13 ||
|
||||
n == 16 || n == 17 || n == 18) {
|
||||
range(n, size, massive);
|
||||
}else if ((n >= 6 && n <= 9) || n == 14 || n == 15 ||
|
||||
(n >= 19 && n <= 30)) {
|
||||
find(n, size, massive);
|
||||
} else {
|
||||
printf("Function number %d invalid.\n", n);
|
||||
}
|
||||
printf("Input: ");
|
||||
}
|
||||
}
|
||||
|
||||
int flush(void){
|
||||
int c;
|
||||
while ((c = getchar()) != '\n' && c != EOF)
|
||||
if (c == 4 || c == 3) return 1;
|
||||
if (c == EOF) return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
#include "func.h"
|
||||
|
||||
void range(int type,int size, int *massive){
|
||||
int x, k, m;
|
||||
|
||||
switch(type){
|
||||
case 1:
|
||||
k = massive[0];
|
||||
m = massive[0];
|
||||
printf("\tFinding max and min int in massive.\n");
|
||||
|
||||
for(int i = 0;i<size;i++){
|
||||
m = (m>massive[i])?m:massive[i];
|
||||
k = (k<massive[i])?k:massive[i];
|
||||
}
|
||||
printf("Max massive int is %d.\n",m);
|
||||
printf("Min massive int is %d.\n\n",k);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 2:
|
||||
printf("\tEnter Range where find max int.\n");
|
||||
printf("Input: min max\nInput: ");
|
||||
while(scanf(" %d %d", &k, &m)!=2 || k<0 || m>size-1|| k>m){
|
||||
if(k<0)printf("min cannot be below 0!\n");
|
||||
if(m>size)printf("max cannot be bigger %d!\n",size);
|
||||
if(k>m)printf("min cannot be bigger than max!\n");
|
||||
if(flush())return;
|
||||
printf("Input: ");
|
||||
}
|
||||
if(flush())return;
|
||||
x=massive[k];
|
||||
for(int i = k;i<=m;i++){
|
||||
x = (x>massive[i])?x:massive[i];
|
||||
}
|
||||
printf("Max massive int betveen [%d] and [%d] is %d.\n\n",k,m,x);
|
||||
break;
|
||||
|
||||
|
||||
case 3:
|
||||
printf("\tEnter Range where find min int.\n");
|
||||
printf("Input: min max\nInput: ");
|
||||
while(scanf(" %d %d", &k, &m)!=2 || k<0 || m>size-1 || k>m){
|
||||
if(k<0)printf("min cannot be below 0!\n");
|
||||
if(m>size)printf("max cannot be bigger %d!\n",size);
|
||||
if(k>m)printf("min cannot be bigger than max!\n");
|
||||
if(flush())return;
|
||||
}
|
||||
if(flush())return;
|
||||
x = massive[k];
|
||||
for(int i = k;i<=m;i++){
|
||||
x = (x<massive[i])?x:massive[i];
|
||||
}
|
||||
printf("Min massive int betveen [%d] and [%d] is %d.\n\n",k,m,x);
|
||||
return;
|
||||
|
||||
|
||||
case 4:
|
||||
printf("\tInput int to find all higher int.\n");
|
||||
printf("\nInput: ");
|
||||
while(scanf(" %d", &k)!=1)
|
||||
if(flush())return;
|
||||
if(flush())return;
|
||||
x = 0;
|
||||
for(int i = 0;i<size;i++){
|
||||
if (massive[i]>k){printf("[%3d]\t{%p}\n",i,&massive[i]);x++;}
|
||||
}
|
||||
if(x==0)printf("int > %d not found.",k);
|
||||
break;
|
||||
|
||||
|
||||
case 5:
|
||||
printf("\tInput int to find all lower int.\n");
|
||||
printf("\nInput: ");
|
||||
while(scanf(" %d", &k)!=1)
|
||||
if(flush())return;
|
||||
if(flush())return;
|
||||
x = 0;
|
||||
for(int i = 0;i<size;i++){
|
||||
if (massive[i]<k){printf("[%3d]\t{%p}\n",i,&massive[i]);x++;}
|
||||
}
|
||||
if(x==0)printf("int < %d not found.",k);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
case 10:
|
||||
printf("\tEnter Range.\n");
|
||||
printf("Input: min max\nInput: ");
|
||||
while(scanf(" %d %d", &k, &m)!=2 || k<0 || m>size-1|| k>m){
|
||||
if(k<0)printf("min cannot be below 0!\n");
|
||||
if(m>size)printf("max cannot be bigger %d!\n",size);
|
||||
if(k>m)printf("min cannot be bigger than max!\n");
|
||||
if(flush())return;
|
||||
printf("Input: ");
|
||||
}
|
||||
if(flush())return;
|
||||
x=massive[k];
|
||||
for(int i = k;i<=m;i++){
|
||||
x += massive[i];
|
||||
}
|
||||
printf("Sum betveen [%d] and [%d] is %d.\n\n",k,m,x);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 12:
|
||||
printf("\tEnter Range where find arithmetic mean\\n.\n");
|
||||
printf("Input: min max\nInput: ");
|
||||
while(scanf(" %d %d", &k, &m)!=2 || k<0 || m>size-1|| k>m){
|
||||
if(k<0)printf("min cannot be below 0!\n");
|
||||
if(m>size)printf("max cannot be bigger %d!\n",size);
|
||||
if(k>m)printf("min cannot be bigger than max!\n");
|
||||
if(flush())return;
|
||||
printf("Input: ");
|
||||
}
|
||||
if(flush())return;
|
||||
x=massive[k];int c=0;
|
||||
for(int i = k;i<=m;i++){
|
||||
x += massive[i];
|
||||
c++;
|
||||
}
|
||||
x /= c;
|
||||
printf("arithmetic mean betveen [%d] and [%d] is %d.\n\n",k,m,x);
|
||||
break;
|
||||
|
||||
|
||||
case 13:
|
||||
k = massive[0];
|
||||
m = massive[0];
|
||||
printf("\tFinding max and min int in massive.\n");
|
||||
|
||||
for(int i = 0;i<size;i++){
|
||||
m = (m>massive[i])?m:massive[i];
|
||||
k = (k<massive[i])?k:massive[i];
|
||||
}
|
||||
for(int i = k;i<m;i++){
|
||||
printf("[%3d]\t{%p}\n",i,&massive[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 17:
|
||||
printf("\tInput Range to find index in between\\n.\n");
|
||||
printf("Input: min max\nInput: ");
|
||||
while(scanf(" %d %d", &k, &m)!=2 || k<0 || m>size-1|| k>m){
|
||||
if(k<0)printf("min cannot be below 0!\n");
|
||||
if(m>size)printf("max cannot be bigger %d!\n",size);
|
||||
if(k>m)printf("min cannot be bigger than max!\n");
|
||||
if(flush())return;
|
||||
printf("Input: ");
|
||||
}
|
||||
if(flush())return;
|
||||
for(int i = k;i<m;i++){
|
||||
printf("[%3d]\t{%p}\n",i,&massive[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 18:
|
||||
printf("\tInput Range to find diff between min and max\\n.\n");
|
||||
printf("Input: min max\nInput: ");
|
||||
while(scanf(" %d %d", &k, &m)!=2 || k<0 || m>size-1|| k>m){
|
||||
if(k<0)printf("min cannot be below 0!\n");
|
||||
if(m>size)printf("max cannot be bigger %d!\n",size);
|
||||
if(k>m)printf("min cannot be bigger than max!\n");
|
||||
if(flush())return;
|
||||
printf("Input: ");
|
||||
}
|
||||
if(flush())return;
|
||||
k = massive[k];
|
||||
m = massive[k];
|
||||
for(int i = k;i<m;i++){
|
||||
m = (m>massive[i])?m:massive[i];
|
||||
k = (k<massive[i])?k:massive[i];
|
||||
}
|
||||
printf("min - %d\tmax - %d\tdiff - %d\n",k,m,m-k);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
a
|
||||
15
|
||||
b
|
||||
12 15 -11 e3 15 19 -11 -99 12 1231 14515 151131 13 1212312 13
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
gcc -std=c99 -Wall main.c ./func/get.c ./func/massive.c ./func/menu.c ./func/special.c ./func/func.c -o prog
|
||||
@@ -0,0 +1,424 @@
|
||||
#include "func.h"
|
||||
|
||||
void func(int x, int (*massive)[COL]){
|
||||
int r, c, i, t, ixac, ixar, ixbc, ixbr, one, two;
|
||||
int a, b, min, max;
|
||||
int inbuff = 0, null = 0;
|
||||
int buff[5];
|
||||
|
||||
switch(x){
|
||||
case 31:
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch min and max in massive:");
|
||||
min = max = a = *(*(massive)); ixar = 0; ixac = 0;
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
a = *(*(massive + c) + r);
|
||||
if(a < min){ min = a; ixac = c; ixar = r; }
|
||||
if(a > max){ max = a; ixbc = c; ixbr = r; }
|
||||
}
|
||||
}
|
||||
printf("\n\tResult: Min:[%lc] | Index [%d;%d]\nMax:[%lc] | Index:[%d;%d]", min, ixac, ixar, max, ixbc, ixbr);
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 32:
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch max in every row and column:");
|
||||
b = a = *(*(massive));
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
a = *(*(massive + c) + r);
|
||||
if(a > b){ b = a; ixac = c; ixar = r; }
|
||||
}
|
||||
printf("\n\tColumn [%d] | Max: %lc | Index [%d;%d]", c, b, ixac, ixar);
|
||||
}
|
||||
b = a = *(*(massive));
|
||||
for(r = 0; r < ROW; r++){
|
||||
for(c = 0; c < COL; c++){
|
||||
a = *(*(massive + c) + r);
|
||||
if(a > b){ b = a; ixac = c; ixar = r; }
|
||||
}
|
||||
printf("\n\tRow [%d] | Max: %lc | Index [%d;%d]", r, b, ixac, ixar);
|
||||
}
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 33:
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch [] > input");
|
||||
inp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ flush(); return; }
|
||||
a = *buff;
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
b = *(*(massive + c) + r);
|
||||
if(b > a)
|
||||
printf("\n\tResult: [%lc] > %lc | Index [%d;%d]", b, a, c, r);
|
||||
}
|
||||
}
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 34:
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch [] < input");
|
||||
inp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ return; }
|
||||
a = *buff;
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
b = *(*(massive + c) + r);
|
||||
if(b < a)
|
||||
printf("\n\tResult: [%lc] < %lc | Index [%d;%d]", b, a, c, r);
|
||||
}
|
||||
}
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 35:
|
||||
t = 0;
|
||||
do{
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch [] > input in Columns Between m and l");
|
||||
finp; printf("k m l\t m & l should be 0-9\n");
|
||||
finp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ return; }
|
||||
a = *buff;
|
||||
one = *(buff + 2);
|
||||
two = *(buff + 4);
|
||||
if(one > two){ one = -1; }
|
||||
} while(!(two >= '0' && two <= '9') && !(one >= '0' && one <= '9'));
|
||||
printf("\nSearch [] > %lc in Columns %lc-%lc", a, one, two);
|
||||
for(; one <= two; one++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
b = *(*(massive + (one - '0')) + r);
|
||||
if(b > a){
|
||||
printf("\n\tResult: [%lc] > %lc | Index [%d;%d]", b, a, one - '0', r); t++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(t == 0) printf("\n\t[] > %lc not found.", a);
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 36:
|
||||
t = 0;
|
||||
do{
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch [] > input in Rows Between m and l");
|
||||
finp; printf("k m l\t m & l should be 0-9\n");
|
||||
finp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ return; }
|
||||
a = *buff;
|
||||
one = *(buff + 2);
|
||||
two = *(buff + 4);
|
||||
if(one > two){ one = -1; }
|
||||
} while(!(two >= '0' && two <= '9') && !(one >= '0' && one <= '9'));
|
||||
printf("\nSearch [] > %lc in Rows %lc-%lc", a, one, two);
|
||||
for(; one <= two; one++){
|
||||
for(c = 0; c < COL; c++){
|
||||
b = *(*(massive + c) + (one - '0'));
|
||||
if(b > a){
|
||||
printf("\n\tResult: [%lc] > %lc | Index [%d;%d]", b, a, c, one - '0'); t++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(t == 0) printf("\n\t[] > %lc not found.", a);
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 37:
|
||||
t = 0;
|
||||
do{
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch [] < input in Columns Between m and l");
|
||||
finp; printf("k m l\t m & l should be 0-9\n");
|
||||
finp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ return; }
|
||||
a = *buff;
|
||||
one = *(buff + 2);
|
||||
two = *(buff + 4);
|
||||
if(one > two){ one = -1; }
|
||||
} while(!(two >= '0' && two <= '9') && !(one >= '0' && one <= '9'));
|
||||
printf("\nSearch [] < %lc in Columns %lc-%lc", a, one, two);
|
||||
for(; one <= two; one++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
b = *(*(massive + (one - '0')) + r);
|
||||
if(b < a){
|
||||
printf("\n\tResult: [%lc] < %lc | Index [%d;%d]", b, a, one - '0', r); t++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(t == 0) printf("\n\t[] < %lc not found.", a);
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 38:
|
||||
t = 0;
|
||||
do{
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch [] < input in Rows Between m and l");
|
||||
finp; printf("k m l\t m & l should be 0-9\n");
|
||||
finp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ return; }
|
||||
a = *buff;
|
||||
one = *(buff + 2);
|
||||
two = *(buff + 4);
|
||||
if(one > two){ one = -1; }
|
||||
} while(!(two >= '0' && two <= '9') && !(one >= '0' && one <= '9'));
|
||||
printf("\nSearch [] < %lc in Rows %lc-%lc", a, one, two);
|
||||
for(; one <= two; one++){
|
||||
for(c = 0; c < COL; c++){
|
||||
b = *(*(massive + c) + (one - '0'));
|
||||
if(b < a){
|
||||
printf("\n\tResult: [%lc] < %lc | Index [%d;%d]", b, a, c, one - '0'); t++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(t == 0) printf("\n\t[] < %lc not found.", a);
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 39:
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSearch all [] between Min & Max in massive.");
|
||||
min = max = a = *(*(massive)); ixac = 0; ixar = 0;
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
a = *(*(massive + c) + r);
|
||||
if(a < min){ min = a; ixac = c; }
|
||||
if(a > max){ max = a; ixar = r; }
|
||||
}
|
||||
}
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
if((*(*(massive + c) + r)) >= min && (*(*(massive + c) + r) <= max)){
|
||||
printf("\n\tResult: [%lc] | Index [%d|%d]", *(*(massive + c) + r), c, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
inp;
|
||||
break;
|
||||
|
||||
case 310:
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
int max = *(*(massive));
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
if(*(*(massive + c) + r) > max)
|
||||
max = *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
printf("\nInput k <= max value %lc: ", max);
|
||||
finp;
|
||||
if((i = buffinput(&null, &inbuff, buff)) == -1){ return; }
|
||||
a = *buff;
|
||||
if(a > max){
|
||||
printf("\nError: k > max value. Try again.");
|
||||
}
|
||||
} while(a > max);
|
||||
for(c = 0; c < COL; c++){
|
||||
for(r = 0; r < ROW; r++){
|
||||
if(*(*(massive + c) + r) % a == 0){
|
||||
printf("\nResult: [%lc] | Index [%d;%d]", *(*(massive + c) + r), c, r);
|
||||
}}}
|
||||
inp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void func2(int x, int (*massive)[COL]){
|
||||
int r,c,sum,i;
|
||||
int inbuff = 0, null = 0;
|
||||
int buff[5];
|
||||
int k;
|
||||
|
||||
switch(x){
|
||||
|
||||
case 311:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of even []");
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = 0; r < ROW; r++){
|
||||
if ((*(*(massive + c) + r)) % 2 == 0)
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 312:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of odd []");
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = 0; r < ROW; r++){
|
||||
if ((*(*(massive + c) + r)) % 2 != 0)
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 313:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of []%%k");
|
||||
finp;
|
||||
|
||||
if ((i = buffinput(&null, &inbuff, buff)) == -1) return;
|
||||
k = *buff;
|
||||
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = 0; r < ROW; r++){
|
||||
if ((*(*(massive + c) + r)) % k == 0)
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 314:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] column%%2==0");
|
||||
|
||||
for (c = 0; c < COL; c += 2){
|
||||
for (r = 0; r < ROW; r++){
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 315:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] column%%2!=0");
|
||||
|
||||
for (c = 1; c < COL; c += 2){
|
||||
for (r = 0; r < ROW; r++){
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 316:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] rows%%2==0");
|
||||
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = 0; r < ROW; r += 2){
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 317:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] rows%%2!=0");
|
||||
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = 1; r < ROW; r += 2){
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 318:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] above main diagonal");
|
||||
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = 0; r <= c; r++){
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 319:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] below main diagonal");
|
||||
|
||||
for (c = 0; c < COL; c++){
|
||||
for (r = c; r < ROW; r++){
|
||||
sum += *(*(massive + c) + r);
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
|
||||
|
||||
case 320:
|
||||
sum = 0;
|
||||
clear();
|
||||
seeMassive(massive);
|
||||
printf("\nSumm of [] on both diagonals");
|
||||
|
||||
for (c = 0; c < COL; c++){
|
||||
sum += *(*(massive + c) + c);
|
||||
sum += *(*(massive + c) + (ROW - 1 - c));
|
||||
}
|
||||
|
||||
printf("\n\tResult: sum %d", sum);
|
||||
inp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef FUNC
|
||||
#define FUNC
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
#define COL 10
|
||||
#define ROW 10
|
||||
|
||||
#define inp printf("\nInput: ");
|
||||
#define finp printf("\nFunction Input: ");
|
||||
|
||||
// GET
|
||||
int mainget(void);
|
||||
int buffinput(int *cell, int *inbuf, int *buff);
|
||||
|
||||
// MASSIVE
|
||||
void seeMassive(int (*massive)[COL]);
|
||||
void setMassive(int x, int (*massive)[COL]);
|
||||
void func(int x, int (*massive)[COL]);
|
||||
void func2(int x, int (*massive)[COL]);
|
||||
|
||||
// MENU
|
||||
void helpMenu(void);
|
||||
void setMenu(void);
|
||||
void funcMenu(void);
|
||||
|
||||
// SPECIAL
|
||||
void clear(void);
|
||||
int flush(void);
|
||||
int end(int c);
|
||||
|
||||
//Massive View
|
||||
#define intervalincell 1
|
||||
#define intervalx 2
|
||||
#define intervaly 2
|
||||
#define symb1 '*'
|
||||
#define symb2 '*'
|
||||
#define symb3 ' '
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "func.h"
|
||||
|
||||
int mainget(void){
|
||||
int t=0,x,y=0,num=0;
|
||||
unsigned long input = 0;
|
||||
while(
|
||||
((x=getwchar())>=32 && t<100)
|
||||
&& ((x>='a' && x<='z')
|
||||
|| (x>='0' && x<= '9')
|
||||
|| (x>='A' && x<='Z'))){
|
||||
//printf("%d %lu ",x,input);
|
||||
if(x>='a' && x<='z') {x -=('a'-'A');t--;}
|
||||
if(x>='A' && x<='Z') {input = (input*100)+(x);t--;}
|
||||
//printf("%d %lu\n",x,input);
|
||||
if(input>1000000000000000000){printf("input err\n\n");flush();input=0;t--;}
|
||||
if(x>='0' && x<='9'&&num<147483647){num = (num*10)+(x-'0');t--;}
|
||||
else if(num>147483647){printf("num is too big!\n\n");num = 0;t--;}
|
||||
if(t<0)t=0;
|
||||
t++;
|
||||
if(end(x))return -1;
|
||||
}
|
||||
if(end(x))return -1;
|
||||
|
||||
int exit = 69887384;
|
||||
int help = 72697680;
|
||||
|
||||
int show = 83727987;
|
||||
|
||||
int set = 836984;
|
||||
|
||||
int func = 70857867;
|
||||
|
||||
|
||||
y=(input == exit)?-1:y;
|
||||
y=(input == 'Q')?-1:y;
|
||||
|
||||
y=(input == help)?1:y;
|
||||
y=(input == 'H')?1:y;
|
||||
|
||||
|
||||
y=(input == set)?2:y;
|
||||
y=(input == 'S')?2:y;
|
||||
if(y==2&&(num>=1&&num<=9)) y = 20+num;
|
||||
if(y==2&&(num==10)) y = 200+num;
|
||||
|
||||
|
||||
y=(input == func)?3:y;
|
||||
y=(input == 'F')?3:y;
|
||||
if(y==3&&(num>=1&&num<=9)) y = 30+num;
|
||||
if(y==3&&(num>=10&&num<=21)) y = 300+num;
|
||||
|
||||
y=(input == show)?4:y;
|
||||
y=(input == 'C')?4:y;
|
||||
|
||||
|
||||
return y;
|
||||
}
|
||||
int buffinput(int *cell, int *inbuff, int *buff){
|
||||
setlocale(LC_ALL, "");
|
||||
wint_t ch;
|
||||
*inbuff = 0;
|
||||
while((ch=getwchar())!='\n'&&*inbuff<5){
|
||||
*(buff+*inbuff)=(int)ch;
|
||||
(*inbuff)++;
|
||||
}
|
||||
// -num- -select cell ----------------------------
|
||||
if(*buff == '-'){
|
||||
*cell = 0;
|
||||
for(int i = 1;i<(*inbuff);i++){
|
||||
if( *(buff+i) >= '0' && *(buff+i) <= '9'){
|
||||
*cell = ((*cell)*10) + ((*(buff+i))- '0');
|
||||
if(*cell>99){*cell=0;}}
|
||||
else if (*(buff+i)!='-') {*cell = 0;break;}
|
||||
}
|
||||
}
|
||||
if(*(buff+(*inbuff-1))=='-'&&*cell>-1)return 1;
|
||||
//-------------------------------------------------
|
||||
|
||||
// exit -------------------------------------------
|
||||
if (*buff =='e'&&
|
||||
*(buff+1)=='x'&&
|
||||
*(buff+2)=='i'&&
|
||||
*(buff+3)=='t'){return -1;}
|
||||
//-------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,609 @@
|
||||
#include "func.h"
|
||||
|
||||
|
||||
#define intervalin for(int i = 0;i<intervalincell;i++)putchar(symb3);
|
||||
#define intervaln for(int i = 0;i<intervaly;i++)putchar('\n');
|
||||
#define intervalbt for(int i = 0;i<intervalx;i++)putchar(symb3);
|
||||
#define dot *(*(massive+col)+row) = '@';
|
||||
|
||||
void mseehelp(int i){
|
||||
putchar(symb1);
|
||||
intervalin;
|
||||
printf("%lc",i);
|
||||
intervalin;
|
||||
putchar(symb2);
|
||||
intervalbt;
|
||||
}
|
||||
void cseehelp(int i){
|
||||
putchar('[');
|
||||
intervalin;
|
||||
putwchar(i);
|
||||
intervalin;
|
||||
putchar(']');
|
||||
intervalbt;
|
||||
}
|
||||
|
||||
void seeMassive(int (*massive)[COL]){
|
||||
printf("\t\t\tMassive\n");
|
||||
|
||||
//corner null
|
||||
cseehelp(symb3);
|
||||
|
||||
// top 0-9
|
||||
for(char i = '0';i<=(COL+'0');i++){
|
||||
if(i!=COL+'0')cseehelp(i);
|
||||
else cseehelp(symb3);
|
||||
}
|
||||
intervaln;
|
||||
|
||||
// Massive
|
||||
for(char i = '0';i<=(ROW+'0');i++){
|
||||
if(i!=ROW+'0'){
|
||||
cseehelp(i);//left 0-9
|
||||
for(char j = '0';j<(COL+'0');j++){
|
||||
mseehelp(*(*(massive+(i-'0'))+(j-'0')));//symbols
|
||||
|
||||
}
|
||||
cseehelp(i);//right 0-9
|
||||
intervaln;
|
||||
}
|
||||
else{ // bottom 0-9
|
||||
cseehelp(symb3);
|
||||
for(char i = '0';i<=(COL+'0');i++){
|
||||
if(i!=COL+'0')cseehelp(i);
|
||||
else cseehelp(symb3);
|
||||
}
|
||||
intervaln;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void setMassive(int settype, int (*massive)[COL]){
|
||||
int re, inbuff=0, buffcmd=1, cell=-1;
|
||||
int x=0,y=0,st=0;
|
||||
int row=0,col=0;
|
||||
int buff[5];
|
||||
switch(settype){
|
||||
case 21:
|
||||
while(buffcmd!=-1){
|
||||
if(row==-1)row=9;
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
clear();
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
if(row<ROW&&col<COL){
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row++;}
|
||||
else if(col<COL-1){
|
||||
row=0;col++;
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row++;}
|
||||
else buffcmd=-1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
row = col = 0;
|
||||
for(;cell>0;){
|
||||
if((cell-10)>=0){cell-=10;col++;}
|
||||
else {cell--;row++;}
|
||||
}
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
case 22:
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+(row+9));
|
||||
dot;
|
||||
clear();
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
if(row>(ROW*-1)&&col<COL){
|
||||
*(*(massive+col)+(row+9))=*(buff+i);
|
||||
row--;
|
||||
if(row==-10){row=0;col++;}
|
||||
}
|
||||
else buffcmd=-1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+col)+(row+9)) = re;
|
||||
row =0; col = 0;
|
||||
for(;cell>0;cell--){
|
||||
if((cell-10)>=0){cell-=10;col++;}
|
||||
else {cell--;row--;}
|
||||
}
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+(row+9)) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
case 23:
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
clear();
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
if(row<ROW&&col<COL){
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col++;
|
||||
if(col==10){col=0;row++;}
|
||||
}
|
||||
else buffcmd=-1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
row = 0; col = 0;
|
||||
for(;cell>0;){
|
||||
if((cell-10)>=0){cell-=10;row++;}
|
||||
else {cell--;col++;}
|
||||
}
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
case 24:
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+(col+9))+row);
|
||||
dot;
|
||||
*(*(massive+(col+9))+row) = 'X';
|
||||
clear();
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
if(row<ROW&&col>(COL*-1)){
|
||||
*(*(massive+(col+9))+row)=*(buff+i);
|
||||
col--;
|
||||
printf("\t%d %d\n",col,col+9);
|
||||
if(col==-10){col=0;row++;}
|
||||
}
|
||||
else buffcmd=-1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+(col+9))+row) = re;
|
||||
row = 0; col = 0;
|
||||
for(;cell>0;){
|
||||
if((cell-10)>=0){cell-=10;row++;}
|
||||
else {cell--;col--;}
|
||||
}
|
||||
}
|
||||
}
|
||||
*(*(massive+(col+9))+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
case 25:
|
||||
x=1,y=1,st=1;
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
clear();
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
switch(st){
|
||||
case 1:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row++;
|
||||
if(row==COL-y){st=2;}
|
||||
break;
|
||||
case 2:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col++;
|
||||
if(col==row)st=3;
|
||||
break;
|
||||
case 3:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row--;
|
||||
if(row==x-1){st=4;y++;}
|
||||
break;
|
||||
case 4:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
if(row==4&&col==5)st=0;
|
||||
col--;
|
||||
if(col==row+1){st=1;x++;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
break;
|
||||
}}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
col=row=0;x=y=1;st=1;
|
||||
for(;cell>0;cell--){
|
||||
switch(st){
|
||||
case 1:
|
||||
row++;
|
||||
if(row==COL-y){st=2;}
|
||||
break;
|
||||
case 2:
|
||||
col++;
|
||||
if(col==row)st=3;
|
||||
break;
|
||||
case 3:
|
||||
row--;
|
||||
if(row==x-1){st=4;y++;}
|
||||
break;
|
||||
case 4:
|
||||
if(row==4&&col==5)st=0;
|
||||
col--;
|
||||
if(col==row+1){st=1;x++;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
|
||||
case 26:
|
||||
x=5,y=5,st=1,row=4,col=5;
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
switch(st){
|
||||
case 1:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row++;
|
||||
if(row==col){st=2;}
|
||||
break;
|
||||
case 2:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col--;
|
||||
if(col==x-1)st=3;
|
||||
break;
|
||||
case 3:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row--;
|
||||
if(col==row+1){st=4;y--;}
|
||||
if(row==-1)st=0;
|
||||
break;
|
||||
case 4:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col++;
|
||||
if(col==COL-y){st=1;x--;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
break;
|
||||
}}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
x=5,y=5,st=1,row=4,col=5;
|
||||
for(;cell>0;cell--){
|
||||
switch(st){
|
||||
case 1:
|
||||
row++;
|
||||
if(row==col){st=2;}
|
||||
break;
|
||||
case 2:
|
||||
col--;
|
||||
if(col==x-1)st=3;
|
||||
break;
|
||||
case 3:
|
||||
row--;
|
||||
if(col==row+1){st=4;y--;}
|
||||
if(row==-1)st=0;
|
||||
break;
|
||||
case 4:
|
||||
col++;
|
||||
if(col==COL-y){st=1;x--;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
|
||||
case 27:
|
||||
x=1,y=9,st=3,row=0,col=9;
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
switch(st){
|
||||
case 1:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row++;
|
||||
if(row==x){st=2;x++;}
|
||||
break;
|
||||
case 2:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col++;
|
||||
if(col==(COL-1)){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
if(x==ROW){st=0;buffcmd=-1;}
|
||||
else{y--;col = y;row=0;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
x=1,y=9,st=3,row=0,col=9;
|
||||
for(;cell>0;cell--){
|
||||
switch(st){
|
||||
case 1:
|
||||
row++;
|
||||
if(row==x){st=2;x++;}
|
||||
break;
|
||||
case 2:
|
||||
col++;
|
||||
if(col==(COL-1)){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
if(x==ROW){st=0;buffcmd=-1;}
|
||||
else{y--;col = y;row=0;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
|
||||
}
|
||||
}
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
|
||||
case 28:
|
||||
x=8,y=0,st=3,row=9,col=0;
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
switch(st){
|
||||
case 1:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row--;
|
||||
if(row==x){st=2;x--;}
|
||||
break;
|
||||
case 2:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col--;
|
||||
if(col==0){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
if(x==-1){st=0;buffcmd=-1;}
|
||||
else{y++;col = y;row=9;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
x=8,y=0,st=3,row=9,col=0;
|
||||
for(;cell>0;cell--){
|
||||
switch(st){
|
||||
case 1:
|
||||
row--;
|
||||
if(row==x){st=2;x--;}
|
||||
break;
|
||||
case 2:
|
||||
col--;
|
||||
if(col==0){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
if(x==-1){st=0;buffcmd=-1;}
|
||||
else{y++;col = y;row=9;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 29:
|
||||
x=1,y=0,st=3,row=0,col=0;
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
switch(st){
|
||||
case 1:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row++;
|
||||
if(row==x){st=2;x++;}
|
||||
break;
|
||||
case 2:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col--;
|
||||
if(col==0){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
if(col==0&&row==ROW-1){st=0;buffcmd=-1;}
|
||||
else{y++;col = y;row=0;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
break;
|
||||
case 1:
|
||||
x=1,y=0,st=3,row=0,col=0;
|
||||
*(*(massive+col)+row) = re;
|
||||
for(;cell>0;cell--){
|
||||
switch(st){
|
||||
case 1:
|
||||
row++;
|
||||
if(row==x){st=2;x++;}
|
||||
break;
|
||||
case 2:
|
||||
col--;
|
||||
if(col==0){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
if(col==0&&row==ROW-1){st=0;buffcmd=-1;}
|
||||
else{y++;col = y;row=0;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
case 210:
|
||||
x=8,y=9,st=3,row=9,col=9;
|
||||
while(buffcmd!=-1){
|
||||
re = *(*(massive+col)+row);
|
||||
dot;
|
||||
printf("\t\t\tMASSIVE EDIT\nInput:\n\t\"-num-\" to select cell\n\t \"exit\" to leave\n");
|
||||
//printf("\ncol:%d row:%d x:%d y:%d st:%d",col,row,x,y,st);
|
||||
seeMassive(massive);
|
||||
printf("Massive input: ");
|
||||
buffcmd = buffinput(&cell,&inbuff,buff);
|
||||
switch(buffcmd){
|
||||
case -1:break;
|
||||
case 0:
|
||||
for(int i = 0;i<inbuff;i++){
|
||||
switch(st){
|
||||
case 1:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
row--;
|
||||
if(row==x){st=2;x--;}
|
||||
break;
|
||||
case 2:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
col++;
|
||||
if(col==(COL-1)){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
*(*(massive+col)+row)=*(buff+i);
|
||||
if(col==COL-1&&row==0){st=0;buffcmd=-1;}
|
||||
else{y--;col = y;row=9;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
break;
|
||||
case 1:
|
||||
*(*(massive+col)+row) = re;
|
||||
x=8,y=9,st=3,row=9,col=9;
|
||||
for(;cell>0;cell--){
|
||||
switch(st){
|
||||
case 1:
|
||||
row--;
|
||||
if(row==x){st=2;x--;}
|
||||
break;
|
||||
case 2:
|
||||
col++;
|
||||
if(col==(COL-1)){st=3;}
|
||||
break;
|
||||
case 3:
|
||||
if(col==COL-1&&row==0){st=0;buffcmd=-1;}
|
||||
else{y--;col = y;row=9;st=1;}
|
||||
break;
|
||||
case 0:
|
||||
buffcmd=-1;
|
||||
}}
|
||||
}
|
||||
}
|
||||
*(*(massive+col)+row) = re;
|
||||
helpMenu();printf("Input: ");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#include "func.h"
|
||||
|
||||
void helpMenu(void){
|
||||
clear();
|
||||
printf("Command [alias] - what it does.\n\n");
|
||||
printf("\thelp [h] - Show this info.\n\n");
|
||||
printf("\tshow [c] - Show the 2d array\n\n");
|
||||
printf("\tset [s] - Show all methods to fill the 2d array.\n");
|
||||
printf("\tset* [s*] - Choose how to fill the 2d array\n\n");
|
||||
printf("\tfunc [f] - Show all functions\n");
|
||||
printf("\tfunc* [f*] - Choose a function.\n\n");
|
||||
printf("\texit [q] - Quite the program.\n\n\n");
|
||||
}
|
||||
|
||||
void setMenu(void){
|
||||
clear();
|
||||
printf("Fill 2d massive methods\n");
|
||||
printf("\t [1] - Row‑wise left‑to‑right input.\n");
|
||||
printf("\t [2] - Row‑wise right‑to‑left input.\n\n");
|
||||
printf("\t *[3] - Column‑wise top‑to‑bottom input.\n");
|
||||
printf("\t [4] - Column‑wise bottom‑to‑top input.\n\n");
|
||||
printf("\t [5] - Spiral from outer edge toward centre.\n");
|
||||
printf("\t [6] - Spiral from centre outward.\n\n");
|
||||
printf("\t [7] - Diagonal input starting at bottom‑left corner.\n");
|
||||
printf("\t [8] - Diagonal input starting at top‑right corner.\n");
|
||||
printf("\t [9] - Diagonal input starting at top‑left corner.\n");
|
||||
printf("\t[10] - Diagonal input starting at bottom‑right corner.\n\n\n");
|
||||
}
|
||||
|
||||
void funcMenu(void){
|
||||
clear();
|
||||
printf("Functions\n");
|
||||
printf("\t [1] - Find the maximum and minimum elements of the matrix.\n");
|
||||
printf("\t [2] - Find the maximum value in each row and in each column of the matrix.\n\n");
|
||||
printf("List elements\n");
|
||||
printf("\t [3] - ... whose values are greater than a given k.\n");
|
||||
printf("\t [4] - ... whose values are less than a given k.\n");
|
||||
printf("\t [5] - ... greater than k in columns m through l.\n");
|
||||
printf("\t [6] - ... greater than k in rows m through l.\n");
|
||||
printf("\t [7] - ... less than k in columns m through l.\n");
|
||||
printf("\t [8] - ... less than k in rows m through l.\n");
|
||||
printf("\t [9] - ... whose values lie between the matrix's minimum and maximum values.\n");
|
||||
printf("\t*[10] - ... that are multiples of the entered number k\n\t\t(k < matrix max; also display the matrix's maximum value).\n\n");
|
||||
printf("Compute the sum of\n");
|
||||
printf("\t[11] - ... all even elements of the matrix.\n");
|
||||
printf("\t[12] - ... odd elements of the matrix.\n");
|
||||
printf("\t[13] - ... elements that are multiples of k.\n");
|
||||
printf("\t[14] - ... elements in even‑indexed columns of the matrix.\n");
|
||||
printf("\t[15] - ... elements in odd‑indexed columns of the matrix.\n");
|
||||
printf("\t*[16] - ... elements in even‑indexed rows of the matrix.\n");
|
||||
printf("\t[17] - ... elements in odd‑indexed rows of the matrix.\n");
|
||||
printf("\t[18] - ... elements on and above the main diagonal (inclusive).\n");
|
||||
printf("\t[19] - ... elements on and below the main diagonal (inclusive).\n");
|
||||
printf("\t[20] - ... elements on both the main and secondary diagonals of the matrix.\n\n\n");
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "func.h"
|
||||
|
||||
void clear(void){
|
||||
printf("\n \033[H\033[J \n\n");
|
||||
}
|
||||
|
||||
|
||||
int flush(void){
|
||||
int c;
|
||||
while ((c = getwchar()) != '\n')
|
||||
if (c<32 && c!='\t') return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int end(int c){
|
||||
if (c<32 && c!= L'\n' && c!=L'\t') return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#include "./func/func.h"
|
||||
int chooseMassiveInput();
|
||||
|
||||
int main(){
|
||||
int x;
|
||||
|
||||
setlocale(LC_ALL, "en_US.UTF-8");
|
||||
//massive data
|
||||
int massive[ROW][COL];
|
||||
for(int i = 0;i<ROW;i++)
|
||||
for(int j = 0;j<COL;j++)
|
||||
*(*(massive+i)+j)='0';
|
||||
//
|
||||
|
||||
clear();
|
||||
helpMenu();
|
||||
inp
|
||||
while((x=mainget())!=-1){
|
||||
|
||||
if(x==1){
|
||||
helpMenu();inp;}
|
||||
|
||||
else if(x==2 || (x>=21 && x<=29) || x==210){
|
||||
if(x==2){setMenu();inp;}
|
||||
else {setMassive(x,massive);flush();}
|
||||
}
|
||||
|
||||
else if(x==3 || (x>=31 && x<=39) || x==310){
|
||||
if(x==3) {funcMenu();inp;}
|
||||
else func(x,massive);
|
||||
}
|
||||
else if((x>=311)&&(x<=320)){func2(x,massive);}
|
||||
else if(x==4){
|
||||
seeMassive(massive);inp;
|
||||
}
|
||||
|
||||
else {printf("Input Error \"%d\" is undefind command.\n",x);
|
||||
printf("\tTo get command list input: help\nInput: ");}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,886 @@
|
||||
|
||||
[H[J
|
||||
|
||||
|
||||
[H[J
|
||||
|
||||
Command [alias] - what it does.
|
||||
|
||||
help [h] - Show this info.
|
||||
|
||||
show [c] - Show the 2d array
|
||||
|
||||
set [s] - Show all methods to fill the 2d array.
|
||||
set* [s*] - Choose how to fill the 2d array
|
||||
|
||||
func [f] - Show all functions
|
||||
func* [f*] - Choose a function.
|
||||
|
||||
exit [q] - Quite the program.
|
||||
|
||||
|
||||
|
||||
Input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 0 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * @ * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 0 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * @ * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 0 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * 0 * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * 0 * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * 0 * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * 0 * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * 0 * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * @ * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * 0 * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * 0 * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * @ * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 0 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 0 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 0 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 0 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * 0 * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * @ * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * 0 * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * 0 * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 0 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * @ * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * 0 * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * 0 * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * 0 * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * 0 * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 0 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * @ * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 0 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 0 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * 0 * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * @ * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * 0 * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * 0 * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * 0 * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * 0 * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * @ * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * 0 * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * 0 * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * 0 * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * 0 * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * @ * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * 0 * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 0 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 0 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 0 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 0 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * @ * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 0 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 0 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 0 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 0 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
MASSIVE EDIT
|
||||
Input:
|
||||
"-num-" to select cell
|
||||
"exit" to leave
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * @ * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 3 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 6 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 1 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 2 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 9 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
Massive input:
|
||||
[H[J
|
||||
|
||||
Command [alias] - what it does.
|
||||
|
||||
help [h] - Show this info.
|
||||
|
||||
show [c] - Show the 2d array
|
||||
|
||||
set [s] - Show all methods to fill the 2d array.
|
||||
set* [s*] - Choose how to fill the 2d array
|
||||
|
||||
func [f] - Show all functions
|
||||
func* [f*] - Choose a function.
|
||||
|
||||
exit [q] - Quite the program.
|
||||
|
||||
|
||||
Input: Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 3 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 6 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 1 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 2 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 9 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
|
||||
Input: Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 3 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 6 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 1 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 2 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 9 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
|
||||
Input: Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 3 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 6 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 1 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 2 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 9 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
|
||||
Input:
|
||||
[H[J
|
||||
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 3 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 6 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 1 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 2 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 9 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
|
||||
Input k <= max value ы:
|
||||
Function Input:
|
||||
Result: [и] | Index [1;4]
|
||||
Input:
|
||||
[H[J
|
||||
|
||||
Massive
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
[ 0 ] * 1 * * 1 * * b * * 7 * * ы * * 9 * * w * * Ф * * 0 * * d * [ 0 ]
|
||||
|
||||
[ 1 ] * 2 * * 2 * * q * * n * * и * * 8 * * 0 * * В * * 0 * * d * [ 1 ]
|
||||
|
||||
[ 2 ] * 7 * * d * * w * * 0 * * щ * * s * * 9 * * Ы * * 0 * * 1 * [ 2 ]
|
||||
|
||||
[ 3 ] * 4 * * 0 * * e * * 9 * * ш * * a * * 8 * * Ф * * a * * 2 * [ 3 ]
|
||||
|
||||
[ 4 ] * 0 * * 9 * * f * * 8 * * г * * d * * 7 * * Ы * * d * * 9 * [ 4 ]
|
||||
|
||||
[ 5 ] * 8 * * x * * b * * ы * * ш * * i * * 4 * * 1 * * s * * 3 * [ 5 ]
|
||||
|
||||
[ 6 ] * 1 * * f * * m * * в * * 7 * * u * * q * * 1 * * a * * 6 * [ 6 ]
|
||||
|
||||
[ 7 ] * 2 * * s * * 0 * * щ * * г * * n * * n * * 1 * * s * * 1 * [ 7 ]
|
||||
|
||||
[ 8 ] * 7 * * d * * 9 * * а * * 1 * * u * * 2 * * 0 * * d * * 2 * [ 8 ]
|
||||
|
||||
[ 9 ] * 0 * * m * * 8 * * г * * 2 * * n * * 0 * * = * * a * * 9 * [ 9 ]
|
||||
|
||||
[ ] [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ ]
|
||||
|
||||
|
||||
Summ of [] rows%2==0
|
||||
Result: sum 10758
|
||||
Input:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user