Forwarded from #include "ampilda.h"
This media is not supported in your browser
VIEW IN TELEGRAM
🍓6 4
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int args, char *argv[]) {
if (args < 2) {
printf("Ошибка сегментации\n"); // я всё равно напишу вместо "введи число" "Ошибка сегментации"
return 255;
}
int num=atoi(argv[1]);
while(1) {
for (int i=1;i<num;i++) {
printf("%*s\r", i, "*");
fflush(stdout);
usleep(60000);
}
for (int i=num;i>0;i--){
printf("%*s\r", i, "* ");
fflush(stdout);
usleep(60000);
}
}}
🤝8👍1
Forwarded from use kawaii::*;
2169 год
@
Все уже перешли на IPv6
@
Почти все белые ip заняли ИИ
@
Надо покупать белые ip
@
Все уже перешли на IPv6
@
Почти все белые ip заняли ИИ
@
Надо покупать белые ip
🍓11 3 2
Forwarded from use kawaii::*;
#include <stdio.h>
int main() {
char zero[20];
double num = 0.1;
for ( double i=0.1; i<10.0; i+=num ) {
printf("%4.17f", i );
fgets(zero, sizeof(zero), stdin);
}
}
😨1
Forwarded from Markinim ^_^
💋9 2🍓1
/* cat -- concatenate files and print on the standard output.
Copyright (C) 1988-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Differences from the Unix cat:
* Always unbuffered, -u is ignored.
* Usually much faster than other versions of cat, the difference
is especially apparent when using the -v option.
By tege@sics.se, Torbjörn Granlund, advised by rms, Richard Stallman. */
#include <config.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
#if HAVE_STROPTS_H
# include <stropts.h>
#endif
#include <sys/ioctl.h>
#include "system.h"
#include "alignalloc.h"
#include "ioblksize.h"
#include "fadvise.h"
#include "full-write.h"
#include "xbinary-io.h"
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cat"
#define AUTHORS \
proper_name_lite ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
proper_name ("Richard M. Stallman")
/* Name of input file. May be "-". */
static char const *infile;
/* Descriptor on which input file is open. */
static int input_desc;
/* Buffer for line numbers.
An 11 digit counter may overflow within an hour on a P2/466,
an 18 digit counter needs about 1000y */
#define LINE_COUNTER_BUF_LEN 20
static char line_buf[LINE_COUNTER_BUF_LEN] =
{
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0',
'\t', '\0'
};
/* Position in 'line_buf' where printing starts. This will not change
unless the number of lines is larger than 999999. */
static char *line_num_print = line_buf + LINE_COUNTER_BUF_LEN - 8;
/* Position of the first digit in 'line_buf'. */
static char *line_num_start = line_buf + LINE_COUNTER_BUF_LEN - 3;
/* Position of the last digit in 'line_buf'. */
static char *line_num_end = line_buf + LINE_COUNTER_BUF_LEN - 3;
/* Preserves the 'cat' function's local 'newlines' between invocations. */
static int newlines2 = 0;
/* Whether there is a pending CR to process. */
static bool pending_cr = false;
void
usage (int status)
{
if (status != EXIT_SUCCESS)
emit_try_help ();
else
{
printf (_("\
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
fputs (_("\
Concatenate FILE(s) to standard output.\n\
"), stdout);
emit_stdin_note ();
fputs (_("\
\n\
-A, --show-all equivalent to -vET\n\
-b, --number-nonblank number nonempty output lines, overrides -n\n\
-e equivalent to -vE\n\
-E, --show-ends display $ or ^M$ at end of each line\n\
-n, --number number all output lines\n\
-s, --squeeze-blank suppress repeated empty output lines\n\
"), stdout);
fputs (_("\
-t equivalent to -vT\n\
-T, --show-tabs display TAB characters as ^I\n\
-u (ignored)\n\
-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
printf (_("\
\n\
Examples:\n\
%s f - g Output f's contents, then standard input, then g's contents.\n\
%s Copy standard input to standard output.\n\
"),
program_name, program_name);
emit_ancillary_info (PROGRAM_NAME);
}
exit (status);
}
/* Compute the next line number. */
🔥5