#include <stdio.h>
#include <conio.h>
#include <ctype.h>
main()
{
const char enter = '\r';
unsigned int s = 0, kol=0;
int i;
char c;
printf("Input text:");
for (int i=0; i<strlen(c); i++)
{
if (c[i]>='0'&&(c[i]<='9')&&((i % 2) == 0)) {
s++;
kol++;
}
}
printf("\nDigits=%u", s);
printf("\nporyad=%u", kol);
_getch();
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
main()
{
const char enter = '\r';
unsigned int s = 0, kol=0,i=0;
char c;
printf("Input text:");
do
{
c = _getche();
if ((i % 2) == 0) {
kol++;
}
if (isdigit(c))s++;
} while (c != enter);
printf("\nDigits=%u", s);
printf("\nporyad=%u", kol);
_getch();
return 0;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Game
{
/// <summary>
/// Логика взаимодействия для Menu.xaml
/// </summary>
public partial class Menu : Page
{
public Menu()
{
InitializeComponent();
}
private void btRefresh_Click(object sender, RoutedEventArgs e)
{
//this.Visible = false;
MainWindow otherForm = new MainWindow();
otherForm.Show();
}
private void Exit_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}